Skip to content

Add release workflow that builds and attaches XCFramework assets#351

Merged
davidkoski merged 1 commit intoml-explore:mainfrom
mattt:mattt/xcframework
Feb 6, 2026
Merged

Add release workflow that builds and attaches XCFramework assets#351
davidkoski merged 1 commit intoml-explore:mainfrom
mattt:mattt/xcframework

Conversation

@mattt
Copy link
Contributor

@mattt mattt commented Feb 5, 2026

Proposed changes

This PR adds a GitHub Actions workflow to automatically build and attach XCFramework artifacts to releases.

This enables API consumers to download prebuilt binaries directly from GitHub releases, significantly reducing build times (as noted in mattt/AnyLanguageModel#9, MLX-related builds can take 75% of total build time).

The workflow:

  • Triggers on published releases (or manually via workflow_dispatch for testing)
  • Builds XCFrameworks for all platforms (iOS, macOS, Mac Catalyst, tvOS, visionOS) using the existing tools/create-xcframework.sh script (added by add xcodeproj as a build method #289)
  • Creates zip archives
  • Uploads them to the release

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING document
  • I have run pre-commit run --all-files to format my code / installed pre-commit prior to committing changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the necessary documentation (if needed)

- name: Upload XCFrameworks to release
if: github.event.release.tag_name || inputs.tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully this part works -- the repo doesn't have such a secret but maybe this is automatic? I am not sure how to test the run of the action until it is merged. No worries, this is new so can't break anything existing :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it goes with GitHub Actions #yolo 🥲

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thrilled to see that the first run succeeded in building the framework! Looks like it stopped just shy of attaching it to a release. Excited to see what happens when it triggers on the next release.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I did the dry run variant -- otherwise it looked like it would build main and attach to the current release (which is a few commits back). Hopefully today.

Copy link
Collaborator

@davidkoski davidkoski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you!

Based on this I think the next steps will be to set up the .xcodeproj in mlx-swift-lm (likely people will want to consume that) and figure out how to get something similar in place there.

@davidkoski davidkoski merged commit 1258900 into ml-explore:main Feb 6, 2026
7 checks passed
@davidkoski
Copy link
Collaborator

OK, here we go for real: https://github.com/ml-explore/mlx-swift/actions/runs/21877309682

@mattt
Copy link
Contributor Author

mattt commented Feb 10, 2026

gh: command not found

🤨

Edit: Oh, it's a self-hosted runner! That explains it.

@davidkoski Can you please brew install gh on the runner and re-try?

@mattt mattt deleted the mattt/xcframework branch February 10, 2026 19:04
@davidkoski davidkoski mentioned this pull request Feb 10, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants