Skip to content

Commit 21f2765

Browse files
committed
Enhance GitHub release workflow with automatic release creation
- Added release name/title (Math vX.Y.Z) - Automatically extracts changelog for the version - Adds documentation link to every release - Includes installation instructions in release notes - Enables GitHub's automatic release notes generation - Marks alpha/beta/rc versions as pre-releases - Outputs version for test-installation job When a tag (v*.*.*) is pushed, the workflow will: 1. Run tests 2. Build release 3. Extract changelog 4. Create GitHub release with formatted notes 5. Test installation on Ubuntu and macOS
1 parent 0dbc94a commit 21f2765

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
runs-on: ubuntu-latest
1212
permissions:
1313
contents: write
14+
outputs:
15+
version: ${{ steps.version.outputs.VERSION }}
1416

1517
steps:
1618
- name: Checkout code
@@ -42,14 +44,32 @@ jobs:
4244
# If empty, use a default message
4345
if [ ! -s release_notes.md ]; then
4446
echo "Release $VERSION" > release_notes.md
47+
echo "" >> release_notes.md
48+
echo "See [CHANGELOG.md](https://github.com/PinkQween/Math/blob/main/CHANGELOG.md) for details." >> release_notes.md
4549
fi
4650
51+
# Add documentation link
52+
echo "" >> release_notes.md
53+
echo "---" >> release_notes.md
54+
echo "" >> release_notes.md
55+
echo "📚 **Documentation:** https://math.hannaskairipa.com" >> release_notes.md
56+
echo "" >> release_notes.md
57+
echo "## Installation" >> release_notes.md
58+
echo "" >> release_notes.md
59+
echo '```swift' >> release_notes.md
60+
echo 'dependencies: [' >> release_notes.md
61+
echo " .package(url: \"https://github.com/PinkQween/Math.git\", from: \"$VERSION\")" >> release_notes.md
62+
echo ']' >> release_notes.md
63+
echo '```' >> release_notes.md
64+
4765
- name: Create GitHub Release
4866
uses: softprops/action-gh-release@v1
4967
with:
68+
name: "Math v${{ steps.version.outputs.VERSION }}"
5069
body_path: release_notes.md
5170
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }}
5271
draft: false
72+
generate_release_notes: true
5373
env:
5474
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5575

0 commit comments

Comments
 (0)