diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e5cee97..33ede53 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,7 @@ on: push: tags: - '*' + workflow_dispatch: permissions: contents: write @@ -75,7 +76,7 @@ jobs: fi - name: Upload binary to release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') with: files: | diff --git a/.github/workflows/release_version.yml b/.github/workflows/release_version.yml index bc53863..10cb390 100644 --- a/.github/workflows/release_version.yml +++ b/.github/workflows/release_version.yml @@ -18,6 +18,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: write + actions: write steps: - name: Checkout code uses: actions/checkout@v4 @@ -30,6 +31,7 @@ jobs: git config user.email "github-actions[bot]@users.noreply.github.com" - name: Bump version and push tag + id: bump run: | # Get the latest tag, default to 0.0.0 if none exists LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0") @@ -66,3 +68,10 @@ jobs: # Create and push the new tag git tag $NEW_TAG git push origin $NEW_TAG + echo "tag=$NEW_TAG" >> "$GITHUB_OUTPUT" + + # A tag pushed with GITHUB_TOKEN doesn't trigger the Release workflow, but a dispatch does. + - name: Start the release build + run: gh workflow run release.yml --ref "${{ steps.bump.outputs.tag }}" + env: + GH_TOKEN: ${{ github.token }}