From a685d9abfa4f3de7870cf85e00f3f65f3cf8b368 Mon Sep 17 00:00:00 2001 From: rzuasti Date: Sun, 7 Jun 2026 11:58:50 -0400 Subject: [PATCH] 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 --- codemagic.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/codemagic.yaml b/codemagic.yaml index e448939..cf49e4a 100644 --- a/codemagic.yaml +++ b/codemagic.yaml @@ -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