Skip to content

Commit

Permalink
ci: download Apple Developer ID Intermediate certificate (#1500)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsanders11 authored Nov 8, 2023
1 parent b2a2051 commit 6c03048
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tools/add-macos-cert.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

set -eo pipefail

KEY_CHAIN=build.keychain
MACOS_CERT_P12_FILE=certificate.p12

Expand Down Expand Up @@ -27,9 +29,18 @@ security default-keychain -s $KEY_CHAIN
# Unlock the keychain
security unlock-keychain -p actions $KEY_CHAIN

# The latest Developer ID Intermediate Certificate from Apple is
# missing on CircleCI, but we need it for the cert to be valid
curl https://www.apple.com/certificateauthority/DeveloperIDG2CA.cer -o DeveloperIDG2CA.cer
sudo security add-trusted-cert -d -r unspecified -k $KEY_CHAIN DeveloperIDG2CA.cer
rm -f DeveloperIDG2CA.cer

security import $MACOS_CERT_P12_FILE -k $KEY_CHAIN -P "$MACOS_CERT_PASSWORD" -T /usr/bin/codesign;

security set-key-partition-list -S apple-tool:,apple: -s -k actions $KEY_CHAIN

# Debugging output
security find-identity

# remove certs
rm -fr *.p12

0 comments on commit 6c03048

Please sign in to comment.