From 66547451996b4c7069707f753be28f503ac9f08f Mon Sep 17 00:00:00 2001 From: Maurice Date: Thu, 5 Nov 2026 21:34:06 +0100 Subject: [PATCH] ci(ios): create a passworded keychain so the distribution cert is usable for signing --- client/fastlane/Fastfile | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/client/fastlane/Fastfile b/client/fastlane/Fastfile index 142b453a7..e499da880 100644 --- a/client/fastlane/Fastfile +++ b/client/fastlane/Fastfile @@ -28,11 +28,28 @@ platform :ios do in_house: false, ) - # A throwaway keychain, so the certificate's private key lives only for this run. - setup_ci + # A throwaway keychain with a known password, so fastlane can unlock the imported + # private key for code signing (without the password it cannot set the key's access + # list and the certificate is never usable). + keychain_name = "trek_ci.keychain" + keychain_password = "trek-ci-#{ENV.fetch('GITHUB_RUN_ID', 'local')}" + create_keychain( + name: keychain_name, + password: keychain_password, + default_keychain: true, + unlock: true, + timeout: 3600, + lock_when_sleeps: false, + ) + keychain_path = File.expand_path("~/Library/Keychains/#{keychain_name}-db") # Distribution certificate into the keychain, and an App Store profile that trusts it. - get_certificates(api_key: key, development: false) + get_certificates( + api_key: key, + development: false, + keychain_path: keychain_path, + keychain_password: keychain_password, + ) get_provisioning_profile( api_key: key, app_identifier: APP_IDENTIFIER,