Skip to content

Add release automation and standalone weights preparation script#1

Closed
olilarkin wants to merge 2 commits into
mainfrom
claude/upbeat-lamport-C8zKX
Closed

Add release automation and standalone weights preparation script#1
olilarkin wants to merge 2 commits into
mainfrom
claude/upbeat-lamport-C8zKX

Conversation

@olilarkin
Copy link
Copy Markdown
Owner

Summary

This PR adds GitHub Actions workflows for CI/release automation and introduces a standalone Python script for weight preparation that can be distributed independently to users.

Key Changes

  • New CI workflow (.github/workflows/ci.yml): Automated builds on pull requests and pushes to main, including XCFramework compilation smoke tests and Swift package builds
  • New Release workflow (.github/workflows/release.yml): Automated release pipeline triggered on version tags or manual dispatch that:
    • Builds multi-platform XCFramework for macOS, iOS, visionOS and their simulators
    • Builds and stages the StableAudioCLI binary for macOS arm64 with colocated MLX metal library
    • Generates comprehensive release notes with usage instructions
    • Publishes GitHub releases with all artifacts
  • New standalone weights script (Scripts/prepare_weights_standalone.py): A self-contained, single-file Python script with PEP 723 inline dependencies that:
    • Mirrors the functionality of Scripts/prepare_weights.py
    • Can be run directly with uv run without cloning the repository
    • Handles downloading gated Stability AI weights via Hugging Face CLI
    • Converts NPZ weight files to safetensors format
    • Extracts tokenizer and conditioner data
    • Generates a manifest JSON for iOS resource loading
    • Supports both small and medium model variants with optional encoder weights
  • Updated prepare_weights.py: Added header comment to maintain sync with the standalone version

Implementation Details

The standalone script uses PEP 723 inline script metadata to declare dependencies (mlx, numpy, huggingface_hub, typer), allowing it to be executed as a self-contained release asset without requiring users to clone the repository or manage dependencies manually.

The release workflow builds artifacts for both the XCFramework (for iOS/macOS development) and a CLI binary (for command-line usage), with the weights preparation script included as a third asset to complete the user experience.

https://claude.ai/code/session_019vj6CEPh2oVt1aDUtR2XVh

claude added 2 commits May 27, 2026 22:41
The release workflow runs on macos-14 when a v* tag is pushed (or on
manual workflow_dispatch, which produces a draft release for dry runs).
It builds the multi-platform XCFramework via Scripts/build-xcframework.sh
with MLXSWIFT_USE_REMOTE=1, builds StableAudioCLI in release config with
a colocated mlx.metallib, and publishes both archives plus a standalone
PEP 723 version of prepare_weights.py. Release notes cover the Gatekeeper
quarantine workaround for the unsigned binary and the uv-based weights
prep flow.

A separate CI workflow on pull_request / push to main verifies that
swift build and a macOS xcframework slice still succeed.
The olilarkin/mlx-swift fork declares swift-tools-version 5.12, which
Xcode 15.4 (Swift 5.10) cannot parse. Pick the newest installed Xcode
instead, and download the Metal toolchain on demand since Xcode 16.3+
ships it as a separate component.
@olilarkin olilarkin closed this May 28, 2026
@olilarkin olilarkin deleted the claude/upbeat-lamport-C8zKX branch May 28, 2026 05:22
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