Skip to content

Commit

Permalink
Update Publish.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Spooks4576 committed Mar 22, 2024
1 parent c9237ea commit 225ccc3
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions .github/workflows/Publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,22 @@ jobs:
- name: Tar artifacts
run: tar -czvf ${{ matrix.board }}.tar.gz -C .pio/build/${{ matrix.board }} firmware.bin partitions.bin bootloader.bin

- 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: Extract commit message
id: commit_message
run: echo "COMMIT_MESSAGE=$(git log -1 --pretty=%B | head -n1 | sed 's/[^a-zA-Z0-9-_]/-/g')" >> $GITHUB_ENV

- name: Print commit message
run: echo "Commit message is $COMMIT_MESSAGE"

- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
files: |
./${{ matrix.board }}.tar.gz
tag_name: ${{ steps.new_tag.outputs.tag }}
name: ${{ steps.new_tag.outputs.tag }}
draft: false
tag_name: ${{ env.COMMIT_MESSAGE }}
name: Release ${{ env.COMMIT_MESSAGE }}
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 225ccc3

Please sign in to comment.