Skip to content

Update downloads page copy #941

Update downloads page copy

Update downloads page copy #941

name: TestFlight on Comment
on:
issue_comment:
types: [created]
permissions:
contents: read
issues: write
pull-requests: write
jobs:
check-comment:
if: github.event.issue.pull_request && contains(github.event.comment.body, 'testflight build')
runs-on: ubuntu-latest
outputs:
should-deploy: ${{ steps.check.outputs.should-deploy }}
pr-number: ${{ steps.check.outputs.pr-number }}
steps:
- name: Check if comment author has write access
uses: actions/github-script@v7
id: check
with:
script: |
const { data: permissions } = await github.rest.repos.getCollaboratorPermissionLevel({
owner: context.repo.owner,
repo: context.repo.repo,
username: context.payload.comment.user.login
});
const hasWriteAccess = ['admin', 'write'].includes(permissions.permission);
if (hasWriteAccess) {
core.setOutput('should-deploy', 'true');
core.setOutput('pr-number', context.issue.number);
// React to the comment to acknowledge
await github.rest.reactions.createForIssueComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
content: 'rocket'
});
// Post a comment
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: '🚀 TestFlight deployment triggered! Check the [Actions tab](https://github.com/' + context.repo.owner + '/' + context.repo.repo + '/actions) for progress.'
});
} else {
core.setOutput('should-deploy', 'false');
// React with thumbs down
await github.rest.reactions.createForIssueComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
content: '-1'
});
}
deploy-testflight:
needs: check-comment
if: needs.check-comment.outputs.should-deploy == 'true'
runs-on: macos-latest-xlarge
steps:
- uses: actions/checkout@v4
with:
ref: ${{ format('refs/pull/{0}/head', needs.check-comment.outputs.pr-number) }}
- 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/testflight-on-comment.yml') }}
restore-keys: |
${{ runner.os }}-brew-
- name: Cache Xcode DerivedData and SourcePackages
uses: irgaly/xcode-cache@v1
with:
key: xcode-cache-testflight-${{ github.workflow }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
xcode-cache-testflight-${{ github.workflow }}-
xcode-cache-testflight-
- 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
restore-keys: |
onnxruntime-ios-built-1.22.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"]
[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"]
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'
- 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
- name: Submit to TestFlight
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 }}
- name: Comment on PR with success
if: success()
uses: actions/github-script@v7
with:
script: |
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ needs.check-comment.outputs.pr-number }},
body: '✅ TestFlight deployment completed successfully!'
});
- name: Comment on PR with failure
if: failure()
uses: actions/github-script@v7
with:
script: |
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ needs.check-comment.outputs.pr-number }},
body: '❌ TestFlight deployment failed. Check the [workflow logs](https://github.com/' + context.repo.owner + '/' + context.repo.repo + '/actions/runs/' + context.runId + ') for details.'
});