forked from ml-explore/mlx-swift
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (52 loc) · 1.64 KB
/
release.yml
File metadata and controls
60 lines (52 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Release XCFrameworks
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: 'Release tag to upload assets to (leave empty for dry run)'
required: false
type: string
permissions:
contents: write
jobs:
build_xcframeworks:
if: github.repository == 'ml-explore/mlx-swift'
runs-on: [self-hosted, macos]
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Verify MetalToolchain installed
shell: bash
run: xcodebuild -showComponent MetalToolchain
- name: Setup gh
shell: sh
run: |
brew install gh
- name: Build XCFrameworks
shell: bash
env:
DEVELOPER_DIR: /Applications/Xcode-latest.app
working-directory: xcode
run: |
xcodebuild -version
../tools/create-xcframework.sh
- name: Create archives
shell: bash
working-directory: xcode/build/output
run: |
for framework in MLX Cmlx MLXNN MLXOptimizers; do
zip -r -y "${framework}.xcframework.zip" "${framework}.xcframework"
done
- name: Upload XCFrameworks to release
if: github.event.release.tag_name || inputs.tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "${{ github.event.release.tag_name || inputs.tag }}" \
xcode/build/output/MLX.xcframework.zip \
xcode/build/output/Cmlx.xcframework.zip \
xcode/build/output/MLXNN.xcframework.zip \
xcode/build/output/MLXOptimizers.xcframework.zip