Skip to content

Commit

Permalink
Update build-release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
BaseMax committed Sep 11, 2024
1 parent 7a47c72 commit fb98d48
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,36 +154,31 @@ jobs:
- name: Set up GitHub CLI
run: sudo apt-get install gh -y

- name: Authenticate GitHub CLI
run: gh auth login --with-token <<< ${{ secrets.GITHUB_TOKEN }}

- name: Get release info
id: release_info
run: |
if gh release view v${{ env.VERSION }}; then
echo "Release exists"
echo "release_exists=true" >> $GITHUB_ENV
else
echo "release_exists=false" >> $GITHUB_ENV
fi
gh release view v${{ env.VERSION }} || echo "Release does not exist"
env:
GH_TOKEN: ${{ github.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Delete existing release and tag if found
if: env.release_exists == 'true'
if: steps.release_info.outcome == 'success'
run: |
gh release delete v${{ env.VERSION }} --yes
git tag -d v${{ env.VERSION }}
git push origin :refs/tags/v${{ env.VERSION }}
env:
GH_TOKEN: ${{ github.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create new Git tag
run: |
git tag v${{ env.VERSION }}
git push origin v${{ env.VERSION }}
env:
GH_TOKEN: ${{ github.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create new GitHub Release and Tag
uses: softprops/action-gh-release@v2
Expand Down

0 comments on commit fb98d48

Please sign in to comment.