From d31913571c153b6dd79952d3f0ce2e54790bfa66 Mon Sep 17 00:00:00 2001 From: Alex-Wengg Date: Wed, 8 Jul 2026 16:39:49 -0400 Subject: [PATCH 1/2] ci: build & publish NemoTextProcessing.xcframework on release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a workflow that runs build-xcframework.sh on a macOS runner (Xcode + the four Apple Rust targets), producing NemoTextProcessing.xcframework (macOS universal + iOS device + iOS simulator). Zips it, computes the SwiftPM SHA-256 checksum, uploads both as a build artifact, and on a `v*` tag attaches them (plus the Swift wrapper) to the GitHub release. This lets Apple consumers (FluidAudio) link the native FFI via a SwiftPM `.binaryTarget(url:checksum:)` instead of hand-linking libtext_processing_rs — the prerequisite for enabling the native TN path by default. --- .github/workflows/xcframework.yml | 54 +++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/xcframework.yml diff --git a/.github/workflows/xcframework.yml b/.github/workflows/xcframework.yml new file mode 100644 index 0000000..529fd6d --- /dev/null +++ b/.github/workflows/xcframework.yml @@ -0,0 +1,54 @@ +name: XCFramework + +# Builds NemoTextProcessing.xcframework (macOS universal + iOS device + iOS +# simulator) so Apple consumers (e.g. FluidAudio) can link the native FFI via +# a SwiftPM `.binaryTarget(url:checksum:)` instead of hand-linking the lib. +on: + push: + tags: ["v*"] + workflow_dispatch: + +permissions: + contents: write + +jobs: + xcframework: + name: Build & publish xcframework + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@stable + with: + targets: aarch64-apple-darwin,x86_64-apple-darwin,aarch64-apple-ios,aarch64-apple-ios-sim + + - name: Build xcframework + run: ./build-xcframework.sh + + - name: Package + checksum + working-directory: output + run: | + zip -ry NemoTextProcessing.xcframework.zip NemoTextProcessing.xcframework + # SwiftPM binary-target checksum is the SHA-256 of the zip. + shasum -a 256 NemoTextProcessing.xcframework.zip | cut -d' ' -f1 \ + > NemoTextProcessing.xcframework.zip.checksum + echo "checksum: $(cat NemoTextProcessing.xcframework.zip.checksum)" + + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: NemoTextProcessing-xcframework + path: | + output/NemoTextProcessing.xcframework.zip + output/NemoTextProcessing.xcframework.zip.checksum + output/NemoTextProcessing.swift + + - name: Attach to release + if: startsWith(github.ref, 'refs/tags/') + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release upload "${GITHUB_REF_NAME}" \ + output/NemoTextProcessing.xcframework.zip \ + output/NemoTextProcessing.xcframework.zip.checksum \ + output/NemoTextProcessing.swift --clobber From a2dbfacf0ddf40b9e01b64f684b6c2bda286fb4f Mon Sep 17 00:00:00 2001 From: Alex-Wengg Date: Wed, 8 Jul 2026 16:40:34 -0400 Subject: [PATCH 2/2] ci(xcframework): validate build on PRs that touch the workflow/build script --- .github/workflows/xcframework.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/xcframework.yml b/.github/workflows/xcframework.yml index 529fd6d..219d3f1 100644 --- a/.github/workflows/xcframework.yml +++ b/.github/workflows/xcframework.yml @@ -6,6 +6,13 @@ name: XCFramework on: push: tags: ["v*"] + # Validate the build itself when the workflow or build inputs change; the + # release-upload step is tag-gated so PR runs only produce a CI artifact. + pull_request: + paths: + - ".github/workflows/xcframework.yml" + - "build-xcframework.sh" + - "swift/**" workflow_dispatch: permissions: