Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions .github/workflows/mobile-build.yml
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -8,159 +8,164 @@

jobs:
build-ios:
runs-on: macos-latest-xlarge
runs-on: macos-26-xlarge
Comment thread
AnthonyRonning marked this conversation as resolved.
steps:
- uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.2.2

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-ios

- name: Cache Homebrew
uses: actions/cache@v4
with:
path: |
~/Library/Caches/Homebrew
/opt/homebrew/Cellar/openssl@3
key: ${{ runner.os }}-brew-${{ hashFiles('.github/workflows/mobile-build.yml') }}
restore-keys: |
${{ runner.os }}-brew-

- name: Cache Xcode DerivedData and SourcePackages
uses: irgaly/xcode-cache@v1
with:
key: xcode-cache-ios-${{ github.workflow }}-${{ hashFiles('**/Cargo.lock') }}
key: xcode-cache-ios-xcode26.2-${{ github.workflow }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
xcode-cache-ios-${{ github.workflow }}-
xcode-cache-ios-
xcode-cache-ios-xcode26.2-${{ github.workflow }}-
xcode-cache-ios-xcode26.2-

- name: Cache Cargo bin (Tauri CLI)
uses: actions/cache@v4
with:
path: ~/.cargo/bin/
key: ${{ runner.os }}-cargo-bin-tauri-cli-2.9.2
restore-keys: |
${{ runner.os }}-cargo-bin-tauri-cli-
${{ runner.os }}-cargo-bin-

- name: Install frontend dependencies
working-directory: ./frontend
run: bun install

- name: Cache ONNX Runtime iOS build
uses: actions/cache@v4
id: cache-onnxruntime
with:
path: |
frontend/src-tauri/onnxruntime-ios
frontend/src-tauri/onnxruntime-build
key: onnxruntime-ios-built-1.22.2-v1
key: onnxruntime-ios-built-1.22.2-xcode26.2-v1
restore-keys: |
onnxruntime-ios-built-1.22.2-
onnxruntime-ios-built-1.22.2-xcode26.2-

- name: Build ONNX Runtime for iOS from source
if: steps.cache-onnxruntime.outputs.cache-hit != 'true'
working-directory: ./frontend/src-tauri
run: |
chmod +x scripts/build-ios-onnxruntime.sh
./scripts/build-ios-onnxruntime.sh 1.22.2
timeout-minutes: 90

- name: Verify ONNX Runtime files
run: |
echo "Checking ONNX Runtime xcframework..."
ls -la ${{ github.workspace }}/frontend/src-tauri/onnxruntime-ios/onnxruntime.xcframework/
ls -la ${{ github.workspace }}/frontend/src-tauri/onnxruntime-ios/onnxruntime.xcframework/ios-arm64/
echo ""
echo "Library info:"
file ${{ github.workspace }}/frontend/src-tauri/onnxruntime-ios/onnxruntime.xcframework/ios-arm64/libonnxruntime.a
echo ""
echo "Checking for Abseil symbols (should be included):"
nm ${{ github.workspace }}/frontend/src-tauri/onnxruntime-ios/onnxruntime.xcframework/ios-arm64/libonnxruntime.a 2>/dev/null | grep -i "absl" | head -20 || echo "No abseil symbols found (they may be internal)"

- name: Configure Cargo for iOS ONNX Runtime
run: |
# Create cargo config with absolute paths for iOS builds
# This overrides ort-sys's build script to use our built-from-source library
WORKSPACE="${{ github.workspace }}"
mkdir -p "${WORKSPACE}/frontend/src-tauri/.cargo"
cat > "${WORKSPACE}/frontend/src-tauri/.cargo/config.toml" << EOF
# Auto-generated cargo config for iOS ONNX Runtime linking
# Uses absolute paths because xcodebuild may run cargo from different directories

[target.aarch64-apple-ios.onnxruntime]
rustc-link-search = ["${WORKSPACE}/frontend/src-tauri/onnxruntime-ios/onnxruntime.xcframework/ios-arm64"]
rustc-link-lib = ["static=onnxruntime"]
# Also link libc++ since ONNX Runtime is C++; overriding ort-sys link metadata
# suppresses the build script's cargo:rustc-link-lib=c++
rustc-link-lib = ["static=onnxruntime", "c++"]

[target.aarch64-apple-ios-sim.onnxruntime]
rustc-link-search = ["${WORKSPACE}/frontend/src-tauri/onnxruntime-ios/onnxruntime.xcframework/ios-arm64-simulator"]
rustc-link-lib = ["static=onnxruntime"]
rustc-link-lib = ["static=onnxruntime", "c++"]
EOF

echo "Generated cargo config:"
cat "${WORKSPACE}/frontend/src-tauri/.cargo/config.toml"

- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.4'
xcode-version: '26.2'

- name: Install Tauri CLI
run: |
if ! command -v cargo-tauri &> /dev/null; then
cargo install tauri-cli --version "2.9.2" --locked
else
echo "Tauri CLI already installed"
fi
env:
# Workaround for getrandom v0.2.16 (https://github.com/rust-random/getrandom/issues/641)
# cargo install builds for the host; on macOS runners target_os is "macos"
CARGO_CFG_TARGET_OS: macos

- name: Set up API Key
run: |
mkdir -p ~/.private_keys
echo "${{ secrets.APPLE_API_PRIVATE_KEY }}" | base64 --decode > ~/.private_keys/AuthKey_${{ secrets.APPLE_API_KEY }}.p8
chmod 600 ~/.private_keys/AuthKey_${{ secrets.APPLE_API_KEY }}.p8
echo "APPLE_API_KEY_PATH=~/.private_keys/AuthKey_${{ secrets.APPLE_API_KEY }}.p8" >> "$GITHUB_ENV"

- name: Build Tauri iOS App
working-directory: ./frontend
run: |
bun tauri ios build --export-method app-store-connect
env:
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
APPLE_API_KEY_PATH: ${{ env.APPLE_API_KEY_PATH }}
APPLE_DEVELOPMENT_TEAM: ${{ secrets.APPLE_TEAM_ID }}
VITE_OPEN_SECRET_API_URL: https://enclave.trymaple.ai
VITE_MAPLE_BILLING_API_URL: https://billing.opensecret.cloud
VITE_CLIENT_ID: ba5a14b5-d915-47b1-b7b1-afda52bc5fc6
# ONNX Runtime location for ort-sys crate
ORT_LIB_LOCATION: ${{ github.workspace }}/frontend/src-tauri/onnxruntime-ios/onnxruntime.xcframework/ios-arm64
# Ensure Swift bridge code is compiled with iOS 16+ deployment target
# to avoid references to removed swiftCompatibility back-deployment libraries
IPHONEOS_DEPLOYMENT_TARGET: '16.0'

- name: Upload iOS App
uses: actions/upload-artifact@v4
with:
name: maple-ios
path: |
frontend/src-tauri/gen/apple/build/arm64/*.ipa
retention-days: 5

- name: Submit to TestFlight
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
# Find the actual path of the IPA file
IPA_PATH=$(find frontend/src-tauri/gen/apple/build -name "*.ipa" | head -n 1)
echo "Found IPA at: $IPA_PATH"

xcrun altool --upload-app --type ios \
--file "$IPA_PATH" \
--apiKey ${{ secrets.APPLE_API_KEY }} \
--apiIssuer ${{ secrets.APPLE_API_ISSUER }}
--apiIssuer ${{ secrets.APPLE_API_ISSUER }}
23 changes: 14 additions & 9 deletions .github/workflows/testflight-on-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
deploy-testflight:
needs: check-comment
if: needs.check-comment.outputs.should-deploy == 'true'
runs-on: macos-latest-xlarge
runs-on: macos-26-xlarge
Comment thread
AnthonyRonning marked this conversation as resolved.
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -93,10 +93,10 @@ jobs:
- name: Cache Xcode DerivedData and SourcePackages
uses: irgaly/xcode-cache@v1
with:
key: xcode-cache-testflight-${{ github.workflow }}-${{ hashFiles('**/Cargo.lock') }}
key: xcode-cache-testflight-xcode26.2-${{ github.workflow }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
xcode-cache-testflight-${{ github.workflow }}-
xcode-cache-testflight-
xcode-cache-testflight-xcode26.2-${{ github.workflow }}-
xcode-cache-testflight-xcode26.2-

- name: Cache Cargo bin (Tauri CLI)
uses: actions/cache@v4
Expand All @@ -118,9 +118,9 @@ jobs:
path: |
frontend/src-tauri/onnxruntime-ios
frontend/src-tauri/onnxruntime-build
key: onnxruntime-ios-built-1.22.2-v1
key: onnxruntime-ios-built-1.22.2-xcode26.2-v1
restore-keys: |
onnxruntime-ios-built-1.22.2-
onnxruntime-ios-built-1.22.2-xcode26.2-

- name: Build ONNX Runtime for iOS from source
if: steps.cache-onnxruntime.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -154,11 +154,13 @@ jobs:

[target.aarch64-apple-ios.onnxruntime]
rustc-link-search = ["${WORKSPACE}/frontend/src-tauri/onnxruntime-ios/onnxruntime.xcframework/ios-arm64"]
rustc-link-lib = ["static=onnxruntime"]
# Also link libc++ since ONNX Runtime is C++; overriding ort-sys link metadata
# suppresses the build script's cargo:rustc-link-lib=c++
rustc-link-lib = ["static=onnxruntime", "c++"]

[target.aarch64-apple-ios-sim.onnxruntime]
rustc-link-search = ["${WORKSPACE}/frontend/src-tauri/onnxruntime-ios/onnxruntime.xcframework/ios-arm64-simulator"]
rustc-link-lib = ["static=onnxruntime"]
rustc-link-lib = ["static=onnxruntime", "c++"]
EOF

echo "Generated cargo config:"
Expand All @@ -167,7 +169,7 @@ jobs:
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.4'
xcode-version: '26.2'

- name: Install Tauri CLI
run: |
Expand Down Expand Up @@ -202,6 +204,9 @@ jobs:
VITE_CLIENT_ID: ba5a14b5-d915-47b1-b7b1-afda52bc5fc6
# ONNX Runtime location for ort-sys crate
ORT_LIB_LOCATION: ${{ github.workspace }}/frontend/src-tauri/onnxruntime-ios/onnxruntime.xcframework/ios-arm64
# Ensure Swift bridge code is compiled with iOS 16+ deployment target
# to avoid references to removed swiftCompatibility back-deployment libraries
IPHONEOS_DEPLOYMENT_TARGET: '16.0'

- name: Submit to TestFlight
run: |
Expand Down
2 changes: 1 addition & 1 deletion frontend/src-tauri/gen/apple/Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Uncomment the next line to define a global platform for your project

target 'maple_iOS' do
platform :ios, '13.0'
platform :ios, '16.0'
# Pods for maple_iOS
end

Expand Down
6 changes: 3 additions & 3 deletions frontend/src-tauri/gen/apple/maple.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -407,7 +407,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -521,7 +521,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down
4 changes: 2 additions & 2 deletions frontend/src-tauri/gen/apple/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: maple
options:
bundleIdPrefix: cloud.opensecret.maple
deploymentTarget:
iOS: 13.0
iOS: 16.0
fileGroups: [../../src]
configs:
debug: debug
Expand Down Expand Up @@ -86,4 +86,4 @@ targets:
basedOnDependencyAnalysis: false
outputFiles:
- $(SRCROOT)/Externals/x86_64/${CONFIGURATION}/libapp.a
- $(SRCROOT)/Externals/arm64/${CONFIGURATION}/libapp.a
- $(SRCROOT)/Externals/arm64/${CONFIGURATION}/libapp.a
3 changes: 2 additions & 1 deletion frontend/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@
"entitlements": "./Entitlements.plist"
},
"iOS": {
"developmentTeam": "X773Y823TN"
"developmentTeam": "X773Y823TN",
"minimumSystemVersion": "16.0"
},
"android": {
"versionCode": 2000018000
Expand Down
Loading