Fix Mac build keychain access (errSecInternalComponent) (#5686)

The Mac build was failing with errSecInternalComponent because the newly
created keychain wasn't added to the search list. Without this step,
codesign cannot find the certificate.

Changes:
- Add keychain to search list with security list-keychains
- Add -T /usr/bin/security to import command for completeness
- Set 1-hour keychain timeout for signing large app bundles

This matches the keychain setup used in the iOS TestFlight workflow.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-28 22:49:22 -08:00
committed by GitHub
co-authored by Claude Opus 4.5
parent 7bef82a419
commit 77791da7c7
+7 -1
View File
@@ -140,11 +140,17 @@ jobs:
security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_NAME"
# Import certificate
security import certificate.p12 -k "$KEYCHAIN_NAME" -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign
security import certificate.p12 -k "$KEYCHAIN_NAME" -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign -T /usr/bin/security
# Allow codesign to access keychain
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" "$KEYCHAIN_NAME"
# Add keychain to search list (required for codesign to find certificates)
security list-keychains -d user -s "$KEYCHAIN_NAME" login.keychain
# Set longer timeout for signing large app bundles
security set-keychain-settings -t 3600 -u "$KEYCHAIN_NAME"
# Clean up
rm certificate.p12