mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-29 00:15:42 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
580188de98 | ||
|
|
63f1e5eca4 |
@@ -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"
|
||||
|
||||
@@ -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" \
|
||||
|
||||
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user