Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multipe certificates to the keychain #10

Open
Siedlerchr opened this issue Aug 9, 2020 · 7 comments
Open

Add multipe certificates to the keychain #10

Siedlerchr opened this issue Aug 9, 2020 · 7 comments

Comments

@Siedlerchr
Copy link

Siedlerchr commented Aug 9, 2020

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
Copy link

M01O commented Dec 26, 2020

ت

@kellyrob99
Copy link

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
Copy link
Author

Yep. That's how I did it as well

@L4ZZA
Copy link

L4ZZA commented Feb 9, 2021

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
Copy link

lolgear commented Feb 25, 2021

@L4ZZA You can convert them as base64 text.

openssl base64 -in MyCertificate.p12 -out MyCertificate.txt

@lolgear
Copy link

lolgear commented Feb 26, 2021

@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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants