Compare commits

...
Author SHA1 Message Date
adminandClaude Opus 4.5 580188de98 Fix iOS archive script: use Unity-iPhone scheme, remove xcpretty
- Always use "Unity-iPhone" scheme (Unity's default app scheme)
- Remove xcpretty dependency (not installed on build machine)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 22:08:16 -08:00
adminandClaude Opus 4.5 63f1e5eca4 Use existing APPLE_ID credentials for TestFlight upload
Reuse the same credentials already used for Mac notarization instead
of requiring a separate App Store Connect API key.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 21:55:21 -08:00
3 changed files with 14 additions and 55 deletions
+2 -1
View File
@@ -158,7 +158,8 @@ jobs:
- name: Upload to TestFlight
if: ${{ github.event.inputs.skip_upload != 'true' }}
env:
APP_STORE_CONNECT_API_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APP_SPECIFIC_PASSWORD: ${{ secrets.APP_SPECIFIC_PASSWORD }}
run: |
chmod +x ./ci/github_actions/upload_testflight.sh
./ci/github_actions/upload_testflight.sh "/tmp/eagle0/archive/eagle0.ipa"
+2 -20
View File
@@ -28,25 +28,12 @@ fi
echo "Found Xcode project: $XCODEPROJ"
# Get the scheme name (usually matches the project name)
SCHEME=$(xcodebuild -list -project "$XCODEPROJ" 2>/dev/null | awk '/Schemes:/{getline; print; exit}' | xargs)
if [ -z "$SCHEME" ]; then
# Fallback: use Unity-iPhone which is the default Unity generates
SCHEME="Unity-iPhone"
fi
# Unity always generates "Unity-iPhone" as the main app scheme
SCHEME="Unity-iPhone"
echo "Using scheme: $SCHEME"
# Archive
xcodebuild archive \
-project "$XCODEPROJ" \
-scheme "$SCHEME" \
-archivePath "$ARCHIVE_PATH" \
-destination "generic/platform=iOS" \
-allowProvisioningUpdates \
CODE_SIGN_STYLE=Manual \
DEVELOPMENT_TEAM="$TEAM_ID" \
PROVISIONING_PROFILE_SPECIFIER="$PROFILE_UUID" \
| xcpretty || xcodebuild archive \
-project "$XCODEPROJ" \
-scheme "$SCHEME" \
-archivePath "$ARCHIVE_PATH" \
@@ -86,11 +73,6 @@ echo "Exporting IPA..."
# Export IPA
xcodebuild -exportArchive \
-archivePath "$ARCHIVE_PATH" \
-exportPath "$EXPORT_PATH" \
-exportOptionsPlist "$EXPORT_OPTIONS_PLIST" \
-allowProvisioningUpdates \
| xcpretty || xcodebuild -exportArchive \
-archivePath "$ARCHIVE_PATH" \
-exportPath "$EXPORT_PATH" \
-exportOptionsPlist "$EXPORT_OPTIONS_PLIST" \
+10 -34
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Upload IPA to TestFlight using App Store Connect API
# Upload IPA to TestFlight using Apple ID credentials (same as Mac notarization)
set -euxo pipefail
@@ -13,51 +13,27 @@ fi
echo "Uploading to TestFlight: $IPA_PATH"
# APP_STORE_CONNECT_API_KEY should be a JSON object with:
# {
# "key_id": "XXXXXXXXXX",
# "issuer_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
# "key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"
# }
# Uses same credentials as Mac notarization:
# - APPLE_ID: Your Apple ID email
# - APP_SPECIFIC_PASSWORD: App-specific password from appleid.apple.com
if [ -z "${APP_STORE_CONNECT_API_KEY:-}" ]; then
echo "Error: APP_STORE_CONNECT_API_KEY environment variable not set"
if [ -z "${APPLE_ID:-}" ]; then
echo "Error: APPLE_ID environment variable not set"
exit 1
fi
# Extract API key components
KEY_ID=$(echo "$APP_STORE_CONNECT_API_KEY" | jq -r '.key_id')
ISSUER_ID=$(echo "$APP_STORE_CONNECT_API_KEY" | jq -r '.issuer_id')
API_KEY=$(echo "$APP_STORE_CONNECT_API_KEY" | jq -r '.key')
if [ -z "$KEY_ID" ] || [ "$KEY_ID" = "null" ]; then
echo "Error: key_id not found in APP_STORE_CONNECT_API_KEY"
if [ -z "${APP_SPECIFIC_PASSWORD:-}" ]; then
echo "Error: APP_SPECIFIC_PASSWORD environment variable not set"
exit 1
fi
# Write API key to file (required format for xcrun)
API_KEY_PATH="/tmp/AuthKey_${KEY_ID}.p8"
echo "$API_KEY" > "$API_KEY_PATH"
chmod 600 "$API_KEY_PATH"
# Upload using xcrun altool (or notarytool for newer Xcode)
# Try xcrun altool first (works with App Store Connect API key)
echo "Uploading with xcrun altool..."
xcrun altool --upload-app \
--type ios \
--file "$IPA_PATH" \
--apiKey "$KEY_ID" \
--apiIssuer "$ISSUER_ID" \
|| {
echo "altool failed, trying xcrun notarytool submit..."
# For newer Xcode versions, might need to use different approach
# This is a fallback - altool should work for TestFlight uploads
exit 1
}
# Cleanup
rm -f "$API_KEY_PATH"
--username "$APPLE_ID" \
--password "$APP_SPECIFIC_PASSWORD"
echo "Upload complete! Check App Store Connect for processing status."
echo "The build should appear in TestFlight within 15-30 minutes after processing."