Skip to content

Commit 99e1679

Browse files
committed
Update release CI to use build.sh and package mlx.metallib instead of default.metallib
1 parent 734b938 commit 99e1679

File tree

1 file changed

+4
-31
lines changed

1 file changed

+4
-31
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -61,46 +61,19 @@ jobs:
6161
echo "Generated changelog with $(echo "$CHANGELOG" | wc -l | tr -d ' ') entries"
6262
6363
- name: Build (Release)
64-
run: swift build -c release
64+
run: ./build.sh
6565

6666
- name: Verify binary
6767
run: |
6868
ls -lh .build/release/SwiftLM
6969
file .build/release/SwiftLM
7070
.build/release/SwiftLM --help || true
7171
72-
- name: Compile default.metallib from source
73-
run: |
74-
# The .metal shader sources are committed to git but the binary
75-
# output (default.metallib) is gitignored. Compile fresh from the
76-
# tracked sources so the metallib is version-matched to the Swift
77-
# binary by construction.
78-
KERNELS="LocalPackages/mlx-swift/Source/Cmlx/mlx/mlx/backend/metal/kernels"
79-
MLX_ROOT="LocalPackages/mlx-swift/Source/Cmlx/mlx"
80-
81-
echo "Compiling $(find "$KERNELS" -name '*.metal' | wc -l | tr -d ' ') Metal shaders..."
82-
mkdir -p /tmp/mlx_air
83-
84-
find "$KERNELS" -name "*.metal" | while read -r f; do
85-
name=$(basename "$f" .metal)
86-
xcrun -sdk macosx metal \
87-
-I "$KERNELS" \
88-
-I "$MLX_ROOT" \
89-
-c "$f" \
90-
-o "/tmp/mlx_air/${name}.air" 2>&1 || echo "WARN: failed to compile $f"
91-
done
92-
93-
AIR_COUNT=$(ls /tmp/mlx_air/*.air 2>/dev/null | wc -l | tr -d ' ')
94-
echo "Linking $AIR_COUNT .air files into default.metallib..."
95-
xcrun -sdk macosx metallib /tmp/mlx_air/*.air -o default.metallib
96-
file default.metallib
97-
ls -lh default.metallib
98-
9972
- name: Package binary
10073
run: |
10174
mkdir -p release
10275
cp .build/release/SwiftLM release/
103-
cp default.metallib release/
76+
cp .build/arm64-apple-macosx/release/mlx.metallib release/
10477
cp LICENSE README.md release/
10578
cd release
10679
# Verify the tarball will be self-contained before archiving
@@ -140,11 +113,11 @@ jobs:
140113
### Quick Start
141114
```bash
142115
tar -xzf SwiftLM-${{ steps.tag.outputs.name }}-macos-arm64.tar.gz
143-
# default.metallib is included — run from the extracted directory
116+
# mlx.metallib is included — run from the extracted directory
144117
./SwiftLM --model mlx-community/Qwen2.5-3B-Instruct-4bit --port 5413
145118
```
146119
147-
> **Note:** `default.metallib` is bundled in this archive. Keep it in the same directory as the `SwiftLM` binary — Metal GPU compute will fail if it is missing.
120+
> **Note:** `mlx.metallib` is bundled in this archive. Keep it in the same directory as the `SwiftLM` binary — Metal GPU compute will fail if it is missing.
148121
RELEASE_EOF
149122
150123
- name: Create release

0 commit comments

Comments
 (0)