mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-29 01:19:44 +00:00
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>
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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