Skip to content

CI workflow: build + publish ant-swift on tag (followup for ant-android) #149

Description

@Nic-dorman

Context

ffi/scripts/build-swift.sh is now reproducible end-to-end: it cross-compiles ant-ffi for iOS device, iOS simulator, and macOS arm64; runs the in-crate uniffi-bindgen; assembles AntFfi.xcframework; zips it; computes the SHA256.

The first release was hand-bootstrapped (ant-swift v0.0.1 is live and consumed-verified). Going forward this should be automated.

What's needed

A GitHub Actions workflow in ant-sdk that runs on tag push (e.g. v*) on a macOS runner:

  1. Set up Rust toolchain + iOS targets (aarch64-apple-ios, aarch64-apple-ios-sim).
  2. Run ffi/scripts/build-swift.sh.
  3. Push to WithAutonomi/ant-swift (using a deploy key or PAT stored as a secret):
    • Update Package.swift URL + checksum to the new tag.
    • Commit + tag with the same v* version.
    • gh release create attaching AntFfi.xcframework.zip.

Notes / lessons

  • Never rewrite a published tag. SPM stores a TOFU fingerprint of the commit hash a tag first pointed at (~/Library/org.swift.swiftpm/security/fingerprints/) and refuses to resolve a tag whose hash changed. Bumping a patch version is always safer.
  • Build script auto-sources $HOME/.cargo/env if cargo isn't on PATH, so the runner doesn't need extra env wiring.
  • Deployment targets (IPHONEOS_DEPLOYMENT_TARGET=16.0, MACOSX_DEPLOYMENT_TARGET=13.0) must match ant-swift's Package.swift platform declarations.

Followup

Mirror this for ant-android (separate issue once the Rust-side Android toolchain work lands).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions