Use a persistent signing key for iOS code signing

Codemagic build VMs are ephemeral, so fetch-signing-files without a
persistent private key creates a distribution certificate that can't be
reused on later builds ("Cannot save Signing Certificates without
certificate private key"). Pass a CERTIFICATE_PRIVATE_KEY secret so the
certificate is created/reused with a key Codemagic owns.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
rzuasti
2026-06-07 11:58:50 -04:00
co-authored by Claude Opus 4.8
parent 59872bde1f
commit a685d9abfa
+4
View File
@@ -47,8 +47,12 @@ workflows:
- name: Set up automatic code signing
script: |
keychain initialize
# Reuse a persistent private key (CERTIFICATE_PRIVATE_KEY secret) so the
# distribution certificate is created/reused with a key Codemagic owns.
# Without this, each ephemeral build VM loses the key and signing fails.
app-store-connect fetch-signing-files "$BUNDLE_ID" \
--type IOS_APP_STORE \
--certificate-key @env:CERTIFICATE_PRIVATE_KEY \
--create
keychain add-certificates
xcode-project use-profiles