Skip to content

Commit

Permalink
fix: cert import
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqingchen committed Oct 30, 2023
1 parent 5a81843 commit b01802b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/scripts/import-certificate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,19 @@ security list-keychains -s build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "" build.keychain
security set-keychain-settings
security import <(echo $SIGNING_CERTIFICATE_P12_DATA | base64 --decode) \
echo "Importing certificate..."
if [ -z "$SIGNING_CERTIFICATE_P12_DATA" ]; then
echo "Error: SIGNING_CERTIFICATE_P12_DATA is not set"
exit 1
fi

if [ -z "$SIGNING_CERTIFICATE_PASSWORD" ]; then
echo "Error: SIGNING_CERTIFICATE_PASSWORD is not set"
exit 1
fi
security import <(echo "$SIGNING_CERTIFICATE_P12_DATA" | base64 --decode) \
-f pkcs12 \
-k build.keychain \
-P $SIGNING_CERTIFICATE_PASSWORD \
-P "$SIGNING_CERTIFICATE_PASSWORD" \
-T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple: -s -k "" build.keychain
echo "Certificate imported successfully"

0 comments on commit b01802b

Please sign in to comment.