Skip to content

Commit

Permalink
Update publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
forntoh committed Oct 7, 2024
1 parent e28cd36 commit 0d1545c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,21 @@ jobs:
- name: Commit changes
env:
GH_PAT: ${{ secrets.GH_PAT }}
GH_TOKEN: ${{ secrets.GH_PAT }}
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git add .
git commit -m "Update version to $UPDATED_VERSION"
git push https://x-access-token:${GH_PAT}@github.com/${{ github.repository }}.git master
git push https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git master --force
- name: Create Tag
if: ${{ env.UPDATED_VERSION != '' }}
env:
GH_TOKEN: ${{ secrets.GH_PAT }}
run: |
git tag -a "${{ env.UPDATED_VERSION }}" -m "Tagging version ${{ env.UPDATED_VERSION }}"
git push https://x-access-token:${GH_PAT}@github.com/${{ github.repository }}.git "${{ env.UPDATED_VERSION }}"
git push https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git "${{ env.UPDATED_VERSION }}" --force
- name: Publish to PlatformIO
id: publish
Expand All @@ -63,11 +65,11 @@ jobs:
- name: Revert push and delete tag if publish fails
if: failure()
env:
GH_PAT: ${{ secrets.GH_PAT }}
GH_TOKEN: ${{ secrets.GH_PAT }}
run: |
git reset --hard HEAD~1
git push https://x-access-token:${GH_PAT}@github.com/${{ github.repository }}.git +HEAD
git tag -d ${{ github.ref_name }}
git push https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git +HEAD --force
git tag -d ${{ env.UPDATED_VERSION }}
- name: Create GitHub Release
if: success()
Expand All @@ -78,4 +80,4 @@ jobs:
tag_name: ${{ github.ref_name }}
release_name: LcdMenu v${{ github.ref_name }}
draft: true
prerelease: false
prerelease: false

0 comments on commit 0d1545c

Please sign in to comment.