Native iOS · Nightly build
Trigger an archive on Git push; let fastlane handle the upload.
Register the cloud Mac as a GitHub Actions self-hosted runner, GitLab Runner or Jenkins agent. On a push to your release branch, check out the pinned commit, then create a Release archive and IPA. Uploading to TestFlight is a separate step, so build and upload failures can be retried independently.
Set up these three things
- Set
WORKSPACE,SCHEMEandEXPORT_OPTIONSto your workspace, shared scheme and export configuration. - Configure the signing certificate and provisioning profile for the build user. You can manage them with fastlane match and inject decrypted credentials through your CI secrets.
- Set
ASC_API_KEY_JSONto the App Store Connect API key JSON used by fastlane. Keep the key out of your source repository.
What to verify
Archive build/App.xcarchive, the exported IPA, the commit identifier and the Xcode version. Confirm that TestFlight received the expected build; a successful build command does not mean the upload is complete.
Why this plan: Host M4 Plus, with 24GB of unified memory, suits everyday builds with multiple targets. Start with serial builds, then consider concurrency based on memory pressure and DerivedData usage.
set -euo pipefail
: "${WORKSPACE:?Set WORKSPACE}"
: "${SCHEME:?Set SCHEME}"
: "${EXPORT_OPTIONS:?Set EXPORT_OPTIONS}"
: "${ASC_API_KEY_JSON:?Set ASC_API_KEY_JSON}"
mkdir -p build
xcodebuild -version
xcodebuild \
-workspace "$WORKSPACE" -scheme "$SCHEME" \
-configuration Release \
-destination 'generic/platform=iOS' \
-archivePath build/App.xcarchive archive
xcodebuild -exportArchive \
-archivePath build/App.xcarchive \
-exportPath build/export \
-exportOptionsPlist "$EXPORT_OPTIONS"
IPA_PATH="$(find build/export -type f -name '*.ipa' -print -quit)"
test -n "$IPA_PATH"
bundle exec fastlane pilot upload \
--ipa "$IPA_PATH" \
--api_key_path "$ASC_API_KEY_JSON"