From c9237eafeded3df55b5b74b65cbfab0d2ef247c7 Mon Sep 17 00:00:00 2001 From: Spooks <62370103+Spooks4576@users.noreply.github.com> Date: Thu, 21 Mar 2024 23:00:24 -0600 Subject: [PATCH] Update Publish.yaml --- .github/workflows/Publish.yaml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Publish.yaml b/.github/workflows/Publish.yaml index 46e9b865..a0f32bac 100644 --- a/.github/workflows/Publish.yaml +++ b/.github/workflows/Publish.yaml @@ -30,9 +30,17 @@ jobs: - name: Tar artifacts run: tar -czvf ${{ matrix.board }}.tar.gz -C .pio/build/${{ matrix.board }} firmware.bin partitions.bin bootloader.bin - - name: Get commit message - id: get_commit_message - run: echo "COMMIT_MESSAGE=$(git log -1 --pretty=%B)" >> $GITHUB_ENV + - name: Fetch all tags + run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* + + - name: Calculate new tag name + id: new_tag + run: | + highest_tag=$(git tag -l 'release-*' | sort -V | tail -n1) + highest_num=${highest_tag##*-} + new_num=$((highest_num + 1)) + echo "New tag will be release-$new_num" + echo "::set-output name=tag::release-$new_num" - name: Create Release id: create_release @@ -40,6 +48,8 @@ jobs: with: files: | ./${{ matrix.board }}.tar.gz + tag_name: ${{ steps.new_tag.outputs.tag }} + name: ${{ steps.new_tag.outputs.tag }} draft: false prerelease: false env: