# Codemagic build of the iOS test port (docs/ios-test-port.md): Godot exports the Xcode project # (export_presets.cfg's "iOS" preset, export only), Codemagic signs it, builds the .ipa, and # uploads it to App Store Connect for TestFlight. Starts manually only (no triggering section). workflows: ios-perf-test: name: iOS perf test (TestFlight) instance_type: mac_mini_m2 max_build_duration: 60 integrations: app_store_connect: Troglodyte # the team's App Store Connect API key (shared with Timbre) environment: # Signing files by their reference names in Codemagic (Team settings > Code signing # identities), fetched into the keychain at build start. ios_signing: certificates: - harvest--seasons provisioning_profiles: - harvest # App Store profile for com.oatmealgames.harvestseason (expires 2027-10-14) vars: BUNDLE_ID: com.oatmealgames.harvestseason APPLE_TEAM_ID: 823T4Q2T3U # The app's numeric Apple ID (App Store Connect > the app > App Information): each build is # numbered one past the latest on TestFlight, so uploads never collide. APP_STORE_APPLE_ID: 6822823738 GODOT_VERSION: 4.7.2 xcode: latest cache: cache_paths: - $HOME/Library/Application Support/Godot/export_templates scripts: - name: Install Godot and the iOS export template script: | set -euo pipefail base="https://github.com/godotengine/godot/releases/download/$GODOT_VERSION-stable" cd "$HOME" curl -fsSL -o godot.zip "$base/Godot_v$GODOT_VERSION-stable_macos.universal.zip" unzip -q -o godot.zip templates="$HOME/Library/Application Support/Godot/export_templates/$GODOT_VERSION.stable" if [ ! -f "$templates/ios.zip" ]; then # The full template set is ~1 GB; only the iOS one is kept (and cached). curl -fsSL -o templates.tpz "$base/Godot_v$GODOT_VERSION-stable_export_templates.tpz" mkdir -p "$templates" unzip -q -j -o templates.tpz templates/ios.zip templates/version.txt -d "$templates" rm templates.tpz fi echo "GODOT=$HOME/Godot.app/Contents/MacOS/Godot" >> "$CM_ENV" - name: Import the project script: | "$GODOT" --headless --path . --import - name: Export the Xcode project script: | set -euo pipefail # The team, bundle ID, and build number come from here (the build number is one past # TestFlight's latest; 1 when there's none yet). latest=$(app-store-connect get-latest-testflight-build-number "$APP_STORE_APPLE_ID" 2>/dev/null || echo 0) [[ "$latest" =~ ^[0-9]+$ ]] || latest=0 build=$(( latest + 1 )) echo "Build number $build" sed -i '' \ -e "s/^application\/app_store_team_id=.*/application\/app_store_team_id=\"$APPLE_TEAM_ID\"/" \ -e "s/^application\/bundle_identifier=.*/application\/bundle_identifier=\"$BUNDLE_ID\"/" \ -e "s/^application\/version=.*/application\/version=\"$build\"/" \ export_presets.cfg mkdir -p build/ios "$GODOT" --headless --path . --export-release "iOS" build/ios/HarvestSeason.ipa test -d build/ios/HarvestSeason.xcodeproj - name: Apply the App Store signing profile script: | xcode-project use-profiles --project build/ios/HarvestSeason.xcodeproj - name: Build the .ipa script: | xcode-project build-ipa --project build/ios/HarvestSeason.xcodeproj --scheme HarvestSeason artifacts: - build/ios/ipa/*.ipa - /tmp/xcodebuild_logs/*.log publishing: app_store_connect: auth: integration # Internal testers get each build without Apple's review; true would also send it to # beta review for external testers. submit_to_testflight: false