Standardize ASR on Tencent's dialect-capable engine across all environments, drop faster-whisper from dependencies and deployment images, and add an expo-sqlite iOS vendor sync plus pod install in prebuild to prevent native build failures after npm install. Co-authored-by: Cursor <cursoragent@cursor.com>
80 lines
2.2 KiB
Bash
Executable File
80 lines
2.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
||
# 本机 iOS Release:切换 env → expo prebuild → 打开 Xcode 打 Archive 上传 TestFlight。
|
||
#
|
||
# 用法(在仓库任意目录):
|
||
# app-expo/scripts/ios-prebuild.sh staging
|
||
# app-expo/scripts/ios-prebuild.sh production
|
||
#
|
||
# 或通过 npm(在 app-expo 目录):
|
||
# npm run ios:prebuild:staging
|
||
# npm run ios:prebuild:production
|
||
#
|
||
# Xcode 内后续步骤(脚本不会自动执行):
|
||
# 1. 选 Any iOS Device(或 Generic iOS Device)
|
||
# 2. Product → Archive
|
||
# 3. Distribute App → App Store Connect → Upload(进入 TestFlight)
|
||
|
||
set -euo pipefail
|
||
|
||
ENV="${1:-}"
|
||
if [[ -z "$ENV" ]]; then
|
||
echo "Usage: $(basename "$0") <staging|production|development>" >&2
|
||
exit 1
|
||
fi
|
||
|
||
case "$ENV" in
|
||
staging | production | development) ;;
|
||
*)
|
||
echo "Unknown environment: $ENV (expected staging, production, or development)" >&2
|
||
exit 1
|
||
;;
|
||
esac
|
||
|
||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||
cd "$ROOT"
|
||
|
||
echo "==> Switching to env/${ENV} → .env"
|
||
npm run use-env -- "$ENV"
|
||
|
||
# Release Archive 时 NODE_ENV=production,Expo 会加载根目录 .env.production 并覆盖 .env
|
||
for legacy in .env.production .env.staging .env.development; do
|
||
if [[ -f "$legacy" ]]; then
|
||
echo "::error::Found legacy $legacy — it overrides use-env on Release builds. Use app-expo/env/ templates only." >&2
|
||
exit 1
|
||
fi
|
||
done
|
||
|
||
echo "==> expo prebuild --platform ios --clean"
|
||
npx expo prebuild --platform ios --clean
|
||
|
||
echo "==> ensure expo-sqlite native sources + pod install"
|
||
node scripts/ensure-expo-sqlite-ios.js
|
||
(cd ios && pod install)
|
||
|
||
shopt -s nullglob
|
||
WORKSPACES=(ios/*.xcworkspace)
|
||
shopt -u nullglob
|
||
|
||
if [[ ${#WORKSPACES[@]} -eq 0 ]]; then
|
||
echo "No ios/*.xcworkspace found after prebuild." >&2
|
||
exit 1
|
||
fi
|
||
|
||
if [[ ${#WORKSPACES[@]} -gt 1 ]]; then
|
||
echo "Multiple workspaces found; opening the first: ${WORKSPACES[0]}" >&2
|
||
fi
|
||
|
||
echo "==> Opening ${WORKSPACES[0]}"
|
||
open "${WORKSPACES[0]}"
|
||
|
||
cat <<EOF
|
||
|
||
Done. In Xcode:
|
||
• Select "Any iOS Device" (or a connected device)
|
||
• Product → Archive
|
||
• Window → Organizer → Distribute App → App Store Connect
|
||
|
||
Environment: ${ENV}
|
||
API URL: $(grep -E '^EXPO_PUBLIC_API_URL=' .env 2>/dev/null | cut -d= -f2- || echo '(see .env)')
|
||
EOF
|