Skip to content

Commit be4eeb4

Browse files
committed
ci(release): replace softprops/action-gh-release with gh CLI
Org GitHub Actions allowlist blocks softprops/action-gh-release@v2, which made the v0.5.1 release run fail before any step executed. Switch to the runner's bundled gh CLI to avoid the third-party action and make the release upload idempotent: if the tag already has a release we re-upload the asset with --clobber, otherwise we create a new release with generated notes. Also add .worktrees/ to .gitignore so locally created worktrees stay untracked.
1 parent 1448b89 commit be4eeb4

2 files changed

Lines changed: 19 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,19 @@ jobs:
6262
run: bun run scripts/prepare-macos-release-bundle.mjs
6363

6464
- name: Create GitHub release and upload app bundle zip
65-
uses: softprops/action-gh-release@v2
66-
with:
67-
tag_name: v${{ steps.version.outputs.version }}
68-
name: v${{ steps.version.outputs.version }}
69-
generate_release_notes: true
70-
files: release/Stave-macOS.zip
65+
env:
66+
GH_TOKEN: ${{ github.token }}
67+
run: |
68+
set -euo pipefail
69+
TAG="v${{ steps.version.outputs.version }}"
70+
ASSET="release/Stave-macOS.zip"
71+
if gh release view "$TAG" >/dev/null 2>&1; then
72+
echo "Release $TAG already exists; updating asset."
73+
gh release upload "$TAG" "$ASSET" --clobber
74+
else
75+
echo "Creating release $TAG."
76+
gh release create "$TAG" \
77+
--title "$TAG" \
78+
--generate-notes \
79+
"$ASSET"
80+
fi

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ tests/artifacts/
3232
debug/
3333
ideas/
3434
ref/
35+
36+
# git worktrees
37+
.worktrees/

0 commit comments

Comments
 (0)