diff --git a/codemagic.yaml b/codemagic.yaml index 9b2efe2..45111b5 100644 --- a/codemagic.yaml +++ b/codemagic.yaml @@ -51,12 +51,14 @@ workflows: - name: Set up code signing script: | - # Automatic signing via the App Store Connect API key configured in the integration above. + # Create the distribution certificate + provisioning profile from the ASC API key and add the + # cert to the keychain. NOTE: `xcode-project use-profiles` is intentionally NOT here — it must + # run AFTER `pod install` generates the workspace, otherwise it fails to wire the profile into + # the App target and the archive dies with "App requires a provisioning profile". keychain initialize app-store-connect fetch-signing-files "$BUNDLE_ID" \ --type IOS_APP_STORE --create keychain add-certificates - xcode-project use-profiles - name: Install CocoaPods script: | @@ -65,6 +67,10 @@ workflows: - name: Build the signed IPA script: | + # Apply the fetched provisioning profile(s) to the Xcode project NOW that the workspace exists, + # then archive. use-profiles scans for **/*.xcodeproj under the repo root and sets manual + # signing (team + profile specifier) on the matching App target. + xcode-project use-profiles xcode-project build-ipa \ --workspace "$XCODE_WORKSPACE" \ --scheme "$XCODE_SCHEME"