Skip to content

Commit 78ff596

Browse files
simbasimba
authored andcommitted
Auto-generate release notes from commit messages + changelog
- Release body now includes the triggering commit message (like llama.cpp) - Auto-generates changelog from git log since last release tag - Includes download link and quick start in release notes
1 parent 47916b8 commit 78ff596

1 file changed

Lines changed: 48 additions & 14 deletions

File tree

.github/workflows/release.yml

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,21 @@ jobs:
4444
echo "full=b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
4545
echo "Build: b${BUILD_NUMBER} (${SHORT_HASH})"
4646
47+
- name: Generate changelog
48+
id: changelog
49+
run: |
50+
# Find the previous release tag
51+
PREV_TAG=$(git tag --sort=-creatordate | head -1 2>/dev/null || echo "")
52+
if [ -z "$PREV_TAG" ]; then
53+
# First release — all commits
54+
CHANGELOG=$(git log --pretty=format:"- %s (%h)" --no-merges -20)
55+
else
56+
CHANGELOG=$(git log "${PREV_TAG}..HEAD" --pretty=format:"- %s (%h)" --no-merges)
57+
fi
58+
# Write to file (multi-line safe)
59+
echo "$CHANGELOG" > /tmp/changelog.txt
60+
echo "Generated changelog with $(echo "$CHANGELOG" | wc -l | tr -d ' ') entries"
61+
4762
- name: Build (Release)
4863
run: swift build -c release
4964

@@ -68,26 +83,45 @@ jobs:
6883
path: mlx-server-${{ steps.tag.outputs.name }}-macos-arm64.tar.gz
6984
retention-days: 90
7085

86+
- name: Prepare release notes
87+
id: notes
88+
run: |
89+
CHANGELOG=$(cat /tmp/changelog.txt)
90+
cat > /tmp/release_notes.md << 'RELEASE_EOF'
91+
## mlx-server ${{ steps.tag.outputs.full }}
92+
93+
<details open>
94+
95+
${{ github.event.head_commit.message }}
96+
97+
</details>
98+
99+
### Changelog
100+
101+
RELEASE_EOF
102+
cat /tmp/changelog.txt >> /tmp/release_notes.md
103+
cat >> /tmp/release_notes.md << 'RELEASE_EOF'
104+
105+
### Download
106+
107+
- [macOS Apple Silicon (arm64)](https://github.com/SharpAI/mlx-server/releases/download/${{ steps.tag.outputs.name }}/mlx-server-${{ steps.tag.outputs.name }}-macos-arm64.tar.gz)
108+
109+
### Quick Start
110+
```bash
111+
tar -xzf mlx-server-${{ steps.tag.outputs.name }}-macos-arm64.tar.gz
112+
./mlx-server --model mlx-community/Qwen2.5-3B-Instruct-4bit --port 5413
113+
```
114+
115+
> **Note:** Requires `mlx.metallib` next to the binary for GPU compute. See [README](https://github.com/SharpAI/mlx-server#metal-shader-library) for setup.
116+
RELEASE_EOF
117+
71118
- name: Create release
72119
if: ${{ github.event_name == 'push' || github.event.inputs.create_release == 'true' }}
73120
uses: softprops/action-gh-release@v2
74121
with:
75122
tag_name: ${{ steps.tag.outputs.name }}
76123
name: "mlx-server ${{ steps.tag.outputs.name }}"
77-
body: |
78-
## mlx-server ${{ steps.tag.outputs.full }}
79-
80-
Native Swift MLX server with OpenAI-compatible API for Apple Silicon.
81-
82-
**Commit:** ${{ github.sha }}
83-
84-
### Quick Start
85-
```bash
86-
tar -xzf mlx-server-${{ steps.tag.outputs.name }}-macos-arm64.tar.gz
87-
./mlx-server --model mlx-community/Qwen2.5-3B-Instruct-4bit --port 5413
88-
```
89-
90-
> **Note:** Requires `mlx.metallib` next to the binary for GPU compute. See [README](https://github.com/SharpAI/mlx-server#metal-shader-library) for setup.
124+
body_path: /tmp/release_notes.md
91125
files: |
92126
mlx-server-${{ steps.tag.outputs.name }}-macos-arm64.tar.gz
93127
draft: false

0 commit comments

Comments
 (0)