Apple-Actions / import-codesign-certs

GitHub Action for Importing Code-signing Certificates into a Keychain
MIT License
186 stars 79 forks source link

Add multipe certificates to the keychain #10

Open Siedlerchr opened 4 years ago

Siedlerchr commented 4 years ago

Hi,

I sucessfully used this action together with the java jpackage tool. However, the jpackage creates both a pkg installer and a dmg. And I think I need to add certs for both. So my question is, can I just copy the action or is there an option to add a second cert?

Edit// I just copied the action and specified a password manually for the keychain For the copy I set create keychain to false

M01O commented 3 years ago

ت

kellyrob99 commented 3 years ago

I was able to make this work, but needed to specify an explicit password for the temporary keychain otherwise the second invocation could not make use of it.

  • if: runner.os == 'macOS' name: Import Certificate - Application uses: apple-actions/import-codesign-certs@v1 with: keychain-password: YOUR_RANDOM_VALUE_HERE p12-file-base64: ${{ secrets.MAC_APPLICATION_CERTIFICATE_DATA }} p12-password: ${{ secrets.MAC_APPLICATION_CERTIFICATE_PASSPHRASE }}
  • if: runner.os == 'macOS' name: Import Certificate - Installer uses: apple-actions/import-codesign-certs@v1 with: create-keychain: false # do not create a new keychain for this value keychain-password: YOUR_RANDOM_VALUE_HERE p12-file-base64: ${{ secrets.MAC_INSTALLER_CERTIFICATE_DATA }} p12-password: ${{ secrets.MAC_INSTALLER_CERTIFICATE_PASSPHRASE }}
Siedlerchr commented 3 years ago

Yep. That's how I did it as well

L4ZZA commented 3 years ago

hey guys, how did you manage to add the p12 certificate as a secret if secrets only allows text input and the p12 file is binary data?

lolgear commented 3 years ago

@L4ZZA You can convert them as base64 text.

openssl base64 -in MyCertificate.p12 -out MyCertificate.txt
lolgear commented 3 years ago

@Siedlerchr Btw, we all didn't read readme properly. It says "import certificates". So, instead of two actions you could just export several certificates as one p12 and import it.

Siedlerchr commented 3 years ago

@lolgear Ah didn't know about that this works as well. Next time I will try this