Update build-macos.yml

This commit is contained in:
Anirudh Sevugan 2025-08-07 20:30:23 -05:00 committed by GitHub
parent 22fe95d424
commit 3c5ebd4ec4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -41,6 +41,7 @@ jobs:
run: | run: |
if [ -z "$CERT_PEM" ]; then if [ -z "$CERT_PEM" ]; then
echo "Certificate secret (MAC_CERTIFICATE_PEM) is missing. Skipping code signing." echo "Certificate secret (MAC_CERTIFICATE_PEM) is missing. Skipping code signing."
exit 1
else else
echo "Certificate secret found. Proceeding with code signing." echo "Certificate secret found. Proceeding with code signing."
fi fi
@ -56,12 +57,18 @@ jobs:
# The -P flag specifies a blank password for the PEM file itself. # The -P flag specifies a blank password for the PEM file itself.
security import cert.pem -k build.keychain -P '' -T /usr/bin/codesign security import cert.pem -k build.keychain -P '' -T /usr/bin/codesign
# Trust the certificate for code signing - name: Add certificate trust
run: |
KEYCHAIN_PASSWORD=""
# This is the crucial step to establish trust for electron-builder.
# Tell the keychain to trust the certificate for the purpose of code signing.
security set-key-partition-list \ security set-key-partition-list \
-S apple-tool: \ -S apple-tool: \
-k "$KEYCHAIN_PASSWORD" \ -k "$KEYCHAIN_PASSWORD" \
build.keychain build.keychain
- name: Verify identity
run: |
# Verify that the identity is now trusted # Verify that the identity is now trusted
security find-identity -v -p codesigning build.keychain security find-identity -v -p codesigning build.keychain