From 5ee7293c3d9c8c1ed1c33d3bd2057915b6ddb9e7 Mon Sep 17 00:00:00 2001 From: Sheikah45 Date: Mon, 13 Jun 2022 09:53:54 -0400 Subject: [PATCH] Add release to upload action --- .github/workflows/upload.yml | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/.github/workflows/upload.yml b/.github/workflows/upload.yml index c5d42f11..8466ec10 100644 --- a/.github/workflows/upload.yml +++ b/.github/workflows/upload.yml @@ -29,6 +29,8 @@ jobs: pacman --noconfirm -S mingw-w64-i686-gcc - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Download Patcher run: curl -L "https://github.com/FAForever/FA_Patcher/releases/latest/download/FaP.exe" -o FaP.exe @@ -45,3 +47,43 @@ jobs: run: curl -f -X "POST" "https://api.faforever.com/exe/upload" -F "modName=${{ github.event.inputs.modName }}" -F "apiKey=${{ secrets.apiKey }}" -F "file=@ForgedAlliance_exxt.exe" + + - name: Get Latest Tag + id: latest_tag + uses: pozetroninc/github-action-get-latest-release@master + with: + repository: ${{ github.repository }} + excludes: prerelease, draft + + - name: Set Tag + id: set_tag + run: | + baseTag=$(date +v%y.%-m.%-d) + tag=${{ github.event.inputs.modName }}_$baseTag + count=1 + + while [ $(git tag -l "$tag") ]; + do + tag=$baseTag.$count; + count=$(($count+1)); + done + echo ::set-output name=tag::$tag + + - name: Get Body + id: get_body + run: | + git log --pretty=format:"* %s" ${{ steps.latest_tag.outputs.release }}..HEAD > body.md + + - name: Create Release + id: create_release + uses: ncipollo/release-action@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + commit: ${{ github.sha }} + tag: ${{ steps.set_tag.outputs.tag }} + name: ${{ steps.set_tag.outputs.tag }} + draft: + token: ${{ secrets.GITHUB_TOKEN }} + bodyFile: body.md + generateReleaseNotes: true