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