ios build fixes

This commit is contained in:
Forrest 2026-07-30 10:06:36 -04:00
parent 16b227cdaa
commit 5d0bb6db81

View file

@ -92,9 +92,13 @@ workflows:
environment: environment:
flutter: 3.44.8 flutter: 3.44.8
java: 17 java: 17
ios_signing: # NOTE: intentionally NO `ios_signing` block. That block triggers
distribution_type: app_store # Codemagic's *automatic* signing during build initialization, which only
bundle_identifier: com.troglodyte.timbre # FETCHES existing certs/profiles and fails the build up front ("No
# matching profiles found") on a fresh account that has none yet. Instead
# we sign fully manually in the scripts below, where we can create the
# cert + profile on first run. The `integrations.app_store_connect` above
# still injects the ASC API-key env vars the app-store-connect CLI uses.
vars: vars:
# The app's numeric Apple ID (App Store Connect → your app → App # The app's numeric Apple ID (App Store Connect → your app → App
# Information → General → Apple ID). Used to auto-bump the build number # Information → General → Apple ID). Used to auto-bump the build number
@ -111,24 +115,27 @@ workflows:
- *get_deps - *get_deps
- *analyze - *analyze
- *unit_tests - *unit_tests
- name: Initialize keychain
# Manual signing: create the build keychain ourselves (the removed
# ios_signing block used to do this automatically).
script: keychain initialize
- name: Fetch signing files - name: Fetch signing files
# Codemagic's automatic signing (the ios_signing block) only *fetches* # fetch-signing-files --create mints the Apple Distribution cert + the
# existing certs/profiles — it never creates them. On a fresh account # App Store provisioning profile via the ASC API key and downloads them.
# with no distribution cert or App Store profile yet, that fetch is # --create also registers the Bundle ID if it isn't already. On the
# empty and `use-profiles` fails with "No matching profiles found". # first build this creates everything; later builds reuse it.
# So we explicitly create-on-miss here: fetch-signing-files --create
# mints the Apple Distribution cert + App Store profile via the ASC API
# key (the App ID must already be registered), add-certificates loads
# the new cert into the build keychain (already initialized by the
# ios_signing block), and use-profiles writes export_options.plist.
# After the first successful run these resources exist and are simply
# reused on subsequent builds.
script: | script: |
app-store-connect fetch-signing-files "com.troglodyte.timbre" \ app-store-connect fetch-signing-files "com.troglodyte.timbre" \
--type IOS_APP_STORE \ --type IOS_APP_STORE \
--create --create
keychain add-certificates - name: Add certificates to keychain
xcode-project use-profiles # Load the freshly fetched distribution cert into the build keychain.
script: keychain add-certificates
- name: Set up code signing
# Applies the profile to the Xcode project and writes
# ~/export_options.plist (= /Users/builder/export_options.plist) that
# the build step reads.
script: xcode-project use-profiles
- name: Build signed IPA - name: Build signed IPA
script: | script: |
BUILD_NUMBER=$(app-store-connect get-latest-testflight-build-number "$APP_STORE_APPLE_ID" 2>/dev/null || echo 0) BUILD_NUMBER=$(app-store-connect get-latest-testflight-build-number "$APP_STORE_APPLE_ID" 2>/dev/null || echo 0)