Skip to content

Commit

Permalink
Update release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
forntoh committed Oct 4, 2024
1 parent 53b5cd8 commit f4c7478
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,23 @@ jobs:
git push origin "${{ env.UPDATED_VERSION }}"
- name: Publish to PlatformIO
id: publish
run: yes y | pio pkg publish
continue-on-error: true

- name: Create GitHub Release
if: ${{ env.UPDATED_VERSION != '' }}
- name: Revert push and delete tag if publish fails
if: failure()
run: |
curl -X POST \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{
"tag_name": "${{ env.UPDATED_VERSION }}",
"target_commitish": "master",
"name": "LcdMenu ${{ env.UPDATED_VERSION }}",
"draft": true,
"prerelease": false
}' \
"https://api.github.com/repos/${{ github.repository }}/releases"
git reset --hard HEAD~1
git push origin +HEAD
git tag -d ${{ github.ref_name }}
git push origin :refs/tags/${{ github.ref_name }}
- name: Create GitHub Release
if: success()
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref_name }}
release_name: LcdMenu v${{ github.ref_name }}
draft: true
prerelease: false

0 comments on commit f4c7478

Please sign in to comment.