GitHub action to create a keychain and import macOS certificates for publishing macOS apps.
- name: Add macOS certs
uses: mskelton/macos-certs@v1
env:
CERT_P12: ${{ secrets.MACOS_CERT_P12 }}
CERT_PASSWORD: ${{ secrets.MACOS_CERT_PASSWORD }}
To export your signing certificates, follow the steps below.
- Login to Apple Developer and go to Certificates, Identifiers & Profiles
- Create the appropriate signing certificates
- Download and add the certificates to your keychain
- Select the certificates and their associated private keys in keychain and
export as a
p12
file. - Run the following command to convert your
p12
file into a base64 string.base64 -i <p12_file> | pbcopy
- Add the copied string to a
CERT_P12
secret in your repo. - Add the password you used when exporting to the
CERT_PASSWORD
secret in your repo.
When exporting your certificates and private keys from keychain, it should look something like this.