diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fe40630..c41911c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ concurrency: cancel-in-progress: false permissions: - contents: read + contents: write env: BUN_VERSION: "1.3.1" @@ -299,3 +299,39 @@ jobs: git add Formula/ git commit -m "Update saguaro formula to ${version}" git push --force-with-lease origin staged + + # ── Create GitHub Release ──────────────────────────────────────────── + github-release: + name: Create GitHub Release + needs: [detect, publish-npm, build] + if: needs.detect.outputs.dry_run != 'true' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/download-artifact@v4 + with: + pattern: binary-* + merge-multiple: true + + - name: Create GitHub Release + env: + GH_TOKEN: ${{ github.token }} + shell: bash + run: | + set -euo pipefail + version="${{ needs.detect.outputs.version }}" + tag="v${version}" + + if gh release view "$tag" >/dev/null 2>&1; then + echo "Release $tag already exists, skipping." + exit 0 + fi + + git tag "$tag" + git push origin "$tag" + + gh release create "$tag" \ + saguaro-*.tar.gz \ + --title "Saguaro v${version}" \ + --generate-notes