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:
- Set up Rust toolchain + iOS targets (
aarch64-apple-ios, aarch64-apple-ios-sim).
- Run
ffi/scripts/build-swift.sh.
- 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).
Context
ffi/scripts/build-swift.shis now reproducible end-to-end: it cross-compiles ant-ffi for iOS device, iOS simulator, and macOS arm64; runs the in-crate uniffi-bindgen; assemblesAntFfi.xcframework; zips it; computes the SHA256.The first release was hand-bootstrapped (
ant-swiftv0.0.1 is live and consumed-verified). Going forward this should be automated.What's needed
A GitHub Actions workflow in
ant-sdkthat runs on tag push (e.g.v*) on a macOS runner:aarch64-apple-ios,aarch64-apple-ios-sim).ffi/scripts/build-swift.sh.WithAutonomi/ant-swift(using a deploy key or PAT stored as a secret):Package.swiftURL + checksum to the new tag.v*version.gh release createattachingAntFfi.xcframework.zip.Notes / lessons
~/Library/org.swift.swiftpm/security/fingerprints/) and refuses to resolve a tag whose hash changed. Bumping a patch version is always safer.$HOME/.cargo/envif cargo isn't on PATH, so the runner doesn't need extra env wiring.IPHONEOS_DEPLOYMENT_TARGET=16.0,MACOSX_DEPLOYMENT_TARGET=13.0) must matchant-swift'sPackage.swiftplatform declarations.Followup
Mirror this for
ant-android(separate issue once the Rust-side Android toolchain work lands).