diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 6da76de2..89b806ae 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -151,12 +151,23 @@ jobs: -F "key='${{ secrets.SERVER_VERSIONS_KEY }}'" \ -F "platform=windows" - - name: Create tag - id: create_tag + - name: Set up GitHub CLI + run: sudo apt-get install gh -y + + - name: Get release info + id: release_info + run: | + if gh release view ${{ github.ref_name }}; then + echo "Release exists" + echo "release_exists=true" >> $GITHUB_ENV + else + echo "release_exists=false" >> $GITHUB_ENV + fi + + - name: Delete existing release if found + if: env.release_exists == 'true' run: | - tag_name="v1.0.${{ github.run_number }}" - git tag $tag_name - git push origin $tag_name + gh release delete ${{ github.ref_name }} --yes - name: Create GitHub Release uses: softprops/action-gh-release@v2