Skip to content

Commit b97e754

Browse files
robertmetaclaude
andcommitted
Use gh CLI for release creation
Replace GitHub Action with gh CLI: - Use 'gh release create' which handles both tag and release - Generate formatted release notes with changes, download, requirements - gh CLI might have better permission handling than third-party actions - Uses GH_TOKEN environment variable This should work with default GitHub Actions permissions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
1 parent fb9b001 commit b97e754

1 file changed

Lines changed: 35 additions & 28 deletions

File tree

.github/workflows/release.yml

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,11 @@ jobs:
9494
ls -lh swiftmac-$VERSION.tar.gz
9595
shell: bash
9696

97-
- name: Create and push tag
98-
run: |
99-
VERSION="${{ needs.check-version.outputs.version }}"
100-
echo "Creating tag v$VERSION"
101-
git config user.name "github-actions[bot]"
102-
git config user.email "github-actions[bot]@users.noreply.github.com"
103-
git tag -a "v$VERSION" -m "Release version $VERSION"
104-
git push origin "v$VERSION"
105-
106-
- name: Extract changelog
107-
id: changelog
97+
- name: Generate release notes
10898
run: |
10999
VERSION="${{ needs.check-version.outputs.version }}"
100+
echo "Generating release notes..."
101+
110102
# Get commits since last tag
111103
LAST_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
112104
if [ -z "$LAST_TAG" ]; then
@@ -115,30 +107,45 @@ jobs:
115107
CHANGES=$(git log --pretty=format:"- %s" ${LAST_TAG}..HEAD)
116108
fi
117109
118-
# Save to file for multiline output
119-
echo "$CHANGES" > CHANGELOG.txt
120-
echo "Extracted changelog for release"
110+
# Create release notes
111+
cat > RELEASE_NOTES.md <<EOF
112+
## SwiftMac ${VERSION}
121113
122-
- name: Create GitHub Release
123-
uses: softprops/action-gh-release@v2
124-
with:
125-
tag_name: v${{ needs.check-version.outputs.version }}
126-
name: SwiftMac ${{ needs.check-version.outputs.version }}
127-
body_path: CHANGELOG.txt
128-
files: |
129-
swiftmac-${{ needs.check-version.outputs.version }}.tar.gz
130-
draft: false
131-
prerelease: false
132-
make_latest: true
133-
env:
134-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114+
**Apple Silicon Release** (arm64)
115+
116+
### Changes
117+
118+
${CHANGES}
119+
120+
### Download
135121
136-
- name: Verify release created
122+
\`\`\`bash
123+
curl -L https://github.com/robertmeta/swiftmac/releases/download/v${VERSION}/swiftmac-${VERSION}.tar.gz | tar xz
124+
\`\`\`
125+
126+
### Requirements
127+
128+
- macOS with Apple Silicon (M1, M2, M3, M4, or newer)
129+
EOF
130+
131+
echo "Release notes created"
132+
133+
- name: Create GitHub Release with gh CLI
137134
run: |
138135
VERSION="${{ needs.check-version.outputs.version }}"
136+
echo "Creating release v$VERSION using gh CLI..."
137+
138+
gh release create "v$VERSION" \
139+
"swiftmac-$VERSION.tar.gz" \
140+
--title "SwiftMac $VERSION" \
141+
--notes-file RELEASE_NOTES.md \
142+
--latest
143+
139144
echo "✅ Release created successfully!"
140145
echo "📦 Download: https://github.com/robertmeta/swiftmac/releases/download/v$VERSION/swiftmac-$VERSION.tar.gz"
141146
echo "🔗 View release: https://github.com/robertmeta/swiftmac/releases/tag/v$VERSION"
147+
env:
148+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
142149

143150
- name: Update latest release symlink
144151
run: |

0 commit comments

Comments
 (0)