feature/project-new-structure
claude/smbcloud-github-app-k9641p
development
feature/apps
feature/build-release
feature/ci-docs
feature/ci-ruby-gems
feature/cicd
feature/completion
feature/dist-nuget
feature/fix-ci-sdk-pypi-rubygem
feature/fix-clippy-on-stable-channel
feature/fix-deployment-script
feature/github-email
feature/gresiq-v1
feature/project-new-structure
feature/rsync-deploy
feature/ruby-runner
feature/sdk-npm
feature/sdk-workflows
feature/smbcloud-cli-release-npm
feature/smbcloud-deploy
feature/wasm
main
release/v0.7.4
| 1 | name: Apple Bridge SDK Verification |
| 2 | |
| 3 | # Verifies the internal Apple bridge crate used for local UniFFI/XCFramework |
| 4 | # development. This workflow does not publish or update the standalone |
| 5 | # smbcloud-auth-swift repository. |
| 6 | # |
| 7 | # It builds the Rust Apple bridge for supported Apple targets, generates the |
| 8 | # UniFFI Swift bindings, assembles a local XCFramework, and uploads the |
| 9 | # generated artifacts for inspection. |
| 10 | |
| 11 | on: |
| 12 | push: |
| 13 | paths: |
| 14 | - ".github/workflows/verify-sdk-apple.yml" |
| 15 | - "Cargo.toml" |
| 16 | - "Cargo.lock" |
| 17 | - "rust-toolchain.toml" |
| 18 | - "crates/smbcloud-auth-sdk-apple/**" |
| 19 | - "crates/smbcloud-auth-sdk/**" |
| 20 | - "crates/smbcloud-model/**" |
| 21 | - "crates/smbcloud-network/**" |
| 22 | pull_request: |
| 23 | paths: |
| 24 | - ".github/workflows/verify-sdk-apple.yml" |
| 25 | - "Cargo.toml" |
| 26 | - "Cargo.lock" |
| 27 | - "rust-toolchain.toml" |
| 28 | - "crates/smbcloud-auth-sdk-apple/**" |
| 29 | - "crates/smbcloud-auth-sdk/**" |
| 30 | - "crates/smbcloud-model/**" |
| 31 | - "crates/smbcloud-network/**" |
| 32 | workflow_dispatch: |
| 33 | |
| 34 | permissions: |
| 35 | contents: read |
| 36 | |
| 37 | env: |
| 38 | CARGO_TERM_COLOR: always |
| 39 | XCFRAMEWORK_NAME: smbcloud_authFFI.xcframework |
| 40 | STATIC_LIB_NAME: libsmbcloud_auth.a |
| 41 | |
| 42 | jobs: |
| 43 | verify-sdk-apple: |
| 44 | name: Verify smbcloud-auth-sdk-apple |
| 45 | runs-on: macos-latest |
| 46 | |
| 47 | steps: |
| 48 | - name: Checkout |
| 49 | uses: actions/checkout@v6 |
| 50 | |
| 51 | - name: Read Rust toolchain |
| 52 | shell: bash |
| 53 | run: | |
| 54 | rust_toolchain="$(sed -n 's/^channel = "\(.*\)"/\1/p' rust-toolchain.toml | head -n 1)" |
| 55 | if [ -z "${rust_toolchain}" ]; then |
| 56 | echo "Failed to read Rust toolchain from rust-toolchain.toml" >&2 |
| 57 | exit 1 |
| 58 | fi |
| 59 | |
| 60 | echo "RUST_TOOLCHAIN=${rust_toolchain}" >> "$GITHUB_ENV" |
| 61 | |
| 62 | - name: Install stable Rust with Apple targets |
| 63 | uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 |
| 64 | with: |
| 65 | toolchain: ${{ env.RUST_TOOLCHAIN }} |
| 66 | targets: aarch64-apple-ios,aarch64-apple-ios-sim,aarch64-apple-darwin |
| 67 | |
| 68 | - name: Install nightly Rust with Apple targets |
| 69 | uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 |
| 70 | with: |
| 71 | toolchain: nightly |
| 72 | components: rust-src |
| 73 | targets: aarch64-apple-tvos,aarch64-apple-tvos-sim,aarch64-apple-visionos,aarch64-apple-visionos-sim |
| 74 | |
| 75 | - name: Setup Rust cache |
| 76 | uses: Swatinem/rust-cache@v2 |
| 77 | with: |
| 78 | key: verify-sdk-apple |
| 79 | |
| 80 | - name: Build UniFFI bindgen helper |
| 81 | shell: bash |
| 82 | run: | |
| 83 | cargo +"${RUST_TOOLCHAIN}" build \ |
| 84 | --manifest-path crates/smbcloud-auth-sdk-apple/Cargo.toml \ |
| 85 | --features bindgen \ |
| 86 | --bin uniffi-bindgen \ |
| 87 | --release |
| 88 | |
| 89 | - name: Build Apple bridge static libraries |
| 90 | shell: bash |
| 91 | run: | |
| 92 | set -euo pipefail |
| 93 | |
| 94 | IPHONEOS_DEPLOYMENT_TARGET=16.0 cargo +"${RUST_TOOLCHAIN}" rustc \ |
| 95 | --manifest-path Cargo.toml \ |
| 96 | --package smbcloud-auth-sdk-apple \ |
| 97 | --target aarch64-apple-ios \ |
| 98 | --release \ |
| 99 | --lib \ |
| 100 | --crate-type staticlib |
| 101 | |
| 102 | IPHONEOS_DEPLOYMENT_TARGET=16.0 cargo +"${RUST_TOOLCHAIN}" rustc \ |
| 103 | --manifest-path Cargo.toml \ |
| 104 | --package smbcloud-auth-sdk-apple \ |
| 105 | --target aarch64-apple-ios-sim \ |
| 106 | --release \ |
| 107 | --lib \ |
| 108 | --crate-type staticlib |
| 109 | |
| 110 | MACOSX_DEPLOYMENT_TARGET=14.0 cargo +"${RUST_TOOLCHAIN}" rustc \ |
| 111 | --manifest-path Cargo.toml \ |
| 112 | --package smbcloud-auth-sdk-apple \ |
| 113 | --target aarch64-apple-darwin \ |
| 114 | --release \ |
| 115 | --lib \ |
| 116 | --crate-type staticlib |
| 117 | |
| 118 | TVOS_DEPLOYMENT_TARGET=16.0 cargo +nightly rustc -Z build-std \ |
| 119 | --manifest-path Cargo.toml \ |
| 120 | --package smbcloud-auth-sdk-apple \ |
| 121 | --target aarch64-apple-tvos \ |
| 122 | --release \ |
| 123 | --lib \ |
| 124 | --crate-type staticlib |
| 125 | |
| 126 | TVOS_DEPLOYMENT_TARGET=16.0 cargo +nightly rustc -Z build-std \ |
| 127 | --manifest-path Cargo.toml \ |
| 128 | --package smbcloud-auth-sdk-apple \ |
| 129 | --target aarch64-apple-tvos-sim \ |
| 130 | --release \ |
| 131 | --lib \ |
| 132 | --crate-type staticlib |
| 133 | |
| 134 | XROS_DEPLOYMENT_TARGET=1.0 cargo +nightly rustc -Z build-std \ |
| 135 | --manifest-path Cargo.toml \ |
| 136 | --package smbcloud-auth-sdk-apple \ |
| 137 | --target aarch64-apple-visionos \ |
| 138 | --release \ |
| 139 | --lib \ |
| 140 | --crate-type staticlib |
| 141 | |
| 142 | XROS_DEPLOYMENT_TARGET=1.0 cargo +nightly rustc -Z build-std \ |
| 143 | --manifest-path Cargo.toml \ |
| 144 | --package smbcloud-auth-sdk-apple \ |
| 145 | --target aarch64-apple-visionos-sim \ |
| 146 | --release \ |
| 147 | --lib \ |
| 148 | --crate-type staticlib |
| 149 | |
| 150 | - name: Generate Swift bindings and assemble XCFramework |
| 151 | id: package |
| 152 | shell: bash |
| 153 | run: | |
| 154 | set -euo pipefail |
| 155 | |
| 156 | build_root="${RUNNER_TEMP}/sdk-apple-build" |
| 157 | generated_dir="${build_root}/generated" |
| 158 | headers_dir="${build_root}/Headers" |
| 159 | frameworks_dir="${build_root}/frameworks" |
| 160 | output_dir="${GITHUB_WORKSPACE}/dist/sdk-apple" |
| 161 | output_xcframework="${output_dir}/${XCFRAMEWORK_NAME}" |
| 162 | bindgen_bin="${GITHUB_WORKSPACE}/target/release/uniffi-bindgen" |
| 163 | |
| 164 | rm -rf "${build_root}" "${output_dir}" |
| 165 | mkdir -p "${generated_dir}" "${headers_dir}" "${frameworks_dir}" "${output_dir}" |
| 166 | |
| 167 | "${bindgen_bin}" generate \ |
| 168 | --library "${GITHUB_WORKSPACE}/target/aarch64-apple-ios/release/${STATIC_LIB_NAME}" \ |
| 169 | --language swift \ |
| 170 | --out-dir "${generated_dir}" |
| 171 | |
| 172 | cp "${generated_dir}/smbcloud_auth.swift" "${output_dir}/smbcloud_auth.swift" |
| 173 | cp "${generated_dir}/smbcloud_authFFI.h" "${headers_dir}/smbcloud_authFFI.h" |
| 174 | cp "${generated_dir}/smbcloud_authFFI.h" "${output_dir}/smbcloud_authFFI.h" |
| 175 | |
| 176 | stage_framework() { |
| 177 | local lib_input="$1" |
| 178 | local framework_output="$2" |
| 179 | |
| 180 | rm -rf "${framework_output}" |
| 181 | mkdir -p "${framework_output}/Headers" "${framework_output}/Modules" |
| 182 | |
| 183 | cp "${lib_input}" "${framework_output}/smbcloud_authFFI" |
| 184 | cp "${headers_dir}/smbcloud_authFFI.h" "${framework_output}/Headers/smbcloud_authFFI.h" |
| 185 | |
| 186 | printf '%s\n' \ |
| 187 | 'framework module smbcloud_authFFI {' \ |
| 188 | ' header "smbcloud_authFFI.h"' \ |
| 189 | ' export *' \ |
| 190 | ' use "Darwin"' \ |
| 191 | ' use "_Builtin_stdbool"' \ |
| 192 | ' use "_Builtin_stdint"' \ |
| 193 | '}' \ |
| 194 | > "${framework_output}/Modules/module.modulemap" |
| 195 | |
| 196 | printf '%s\n' \ |
| 197 | '<?xml version="1.0" encoding="UTF-8"?>' \ |
| 198 | '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd">' \ |
| 199 | '<plist version="1.0">' \ |
| 200 | '<dict>' \ |
| 201 | ' <key>CFBundleIdentifier</key>' \ |
| 202 | ' <string>xyz.smbcloud.smbcloud-auth-ffi</string>' \ |
| 203 | ' <key>CFBundleName</key>' \ |
| 204 | ' <string>smbcloud_authFFI</string>' \ |
| 205 | ' <key>CFBundleExecutable</key>' \ |
| 206 | ' <string>smbcloud_authFFI</string>' \ |
| 207 | ' <key>CFBundlePackageType</key>' \ |
| 208 | ' <string>FMWK</string>' \ |
| 209 | ' <key>CFBundleShortVersionString</key>' \ |
| 210 | ' <string>dev</string>' \ |
| 211 | ' <key>CFBundleVersion</key>' \ |
| 212 | ' <string>1</string>' \ |
| 213 | '</dict>' \ |
| 214 | '</plist>' \ |
| 215 | > "${framework_output}/Info.plist" |
| 216 | } |
| 217 | |
| 218 | stage_framework \ |
| 219 | "${GITHUB_WORKSPACE}/target/aarch64-apple-ios/release/${STATIC_LIB_NAME}" \ |
| 220 | "${frameworks_dir}/ios/smbcloud_authFFI.framework" |
| 221 | stage_framework \ |
| 222 | "${GITHUB_WORKSPACE}/target/aarch64-apple-ios-sim/release/${STATIC_LIB_NAME}" \ |
| 223 | "${frameworks_dir}/ios-sim/smbcloud_authFFI.framework" |
| 224 | stage_framework \ |
| 225 | "${GITHUB_WORKSPACE}/target/aarch64-apple-darwin/release/${STATIC_LIB_NAME}" \ |
| 226 | "${frameworks_dir}/macos/smbcloud_authFFI.framework" |
| 227 | stage_framework \ |
| 228 | "${GITHUB_WORKSPACE}/target/aarch64-apple-tvos/release/${STATIC_LIB_NAME}" \ |
| 229 | "${frameworks_dir}/tvos/smbcloud_authFFI.framework" |
| 230 | stage_framework \ |
| 231 | "${GITHUB_WORKSPACE}/target/aarch64-apple-tvos-sim/release/${STATIC_LIB_NAME}" \ |
| 232 | "${frameworks_dir}/tvos-sim/smbcloud_authFFI.framework" |
| 233 | stage_framework \ |
| 234 | "${GITHUB_WORKSPACE}/target/aarch64-apple-visionos/release/${STATIC_LIB_NAME}" \ |
| 235 | "${frameworks_dir}/visionos/smbcloud_authFFI.framework" |
| 236 | stage_framework \ |
| 237 | "${GITHUB_WORKSPACE}/target/aarch64-apple-visionos-sim/release/${STATIC_LIB_NAME}" \ |
| 238 | "${frameworks_dir}/visionos-sim/smbcloud_authFFI.framework" |
| 239 | |
| 240 | xcodebuild -create-xcframework \ |
| 241 | -framework "${frameworks_dir}/ios/smbcloud_authFFI.framework" \ |
| 242 | -framework "${frameworks_dir}/ios-sim/smbcloud_authFFI.framework" \ |
| 243 | -framework "${frameworks_dir}/macos/smbcloud_authFFI.framework" \ |
| 244 | -framework "${frameworks_dir}/tvos/smbcloud_authFFI.framework" \ |
| 245 | -framework "${frameworks_dir}/tvos-sim/smbcloud_authFFI.framework" \ |
| 246 | -framework "${frameworks_dir}/visionos/smbcloud_authFFI.framework" \ |
| 247 | -framework "${frameworks_dir}/visionos-sim/smbcloud_authFFI.framework" \ |
| 248 | -output "${output_xcframework}" |
| 249 | |
| 250 | ditto -c -k --sequesterRsrc --keepParent \ |
| 251 | "${output_xcframework}" \ |
| 252 | "${output_dir}/${XCFRAMEWORK_NAME}.zip" |
| 253 | |
| 254 | echo "artifact_dir=${output_dir}" >> "$GITHUB_OUTPUT" |
| 255 | |
| 256 | - name: Upload Apple bridge artifacts |
| 257 | uses: actions/upload-artifact@v7 |
| 258 | with: |
| 259 | name: sdk-apple-artifacts |
| 260 | path: ${{ steps.package.outputs.artifact_dir }} |
| 261 | |
| 262 | - name: Publish summary |
| 263 | shell: bash |
| 264 | run: | |
| 265 | cat <<EOF >> "$GITHUB_STEP_SUMMARY" |
| 266 | ## Apple bridge SDK verification |
| 267 | |
| 268 | Verified crate: `smbcloud-auth-sdk-apple` |
| 269 | |
| 270 | Generated artifacts: |
| 271 | - UniFFI Swift bindings |
| 272 | - smbcloud_authFFI XCFramework |
| 273 | - zipped XCFramework artifact |
| 274 | EOF |