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

security: SecKeychainItemImport: Unknown format in import. #80

Open
amjedsaleel opened this issue Jul 6, 2022 · 3 comments
Open

security: SecKeychainItemImport: Unknown format in import. #80

amjedsaleel opened this issue Jul 6, 2022 · 3 comments

Comments

@amjedsaleel
Copy link

amjedsaleel commented Jul 6, 2022

I am specified the p12-key-path and p12-cer-path. My pipeline is failed due to Unknown format in import.

- uses: yukiarrr/[email protected]
  with:
    project-path: Unity-iPhone.xcodeproj
    p12-key-path: ./certificates/CVJDMPG837.p12
    p12-cer-path: ./certificates/CVJDMPG837.cer
    p12-key-base64: ${{ secrets.P12_KEY_BASE64 }}
    p12-cer-base64: ${{ secrets.P12_CER_BASE64 }}
    mobileprovision-base64: ${{ secrets.MOBILEPROVISION_BASE64 }}
@HunainHumail
Copy link

Any solution?n

@amjedsaleel
Copy link
Author

@HunainHumail still not get any solutions

@peterchege
Copy link

peterchege commented Aug 26, 2022

@amjedsaleel

edit with this format and try:

  • name: Build IOS App
    uses: yukiarrr/[email protected]
    with:
    project-path: ios/yourProjectName.xcodeproj
    p12-base64: ${{ secrets.IOS_P12_BASE64 }} //
    mobileprovision-base64: ${{ secrets.IOS_MOBILE_PROVISION_BASE64 }}
    code-signing-identity: 'iPhone Distribution'
    team-id: ${{ secrets.IOS_TEAM_ID }}
    certificate-password: ${{ secrets.IOS_CERTIFICATE_PASSWORD }}
    workspace-path: ios/yourProjectName.xcworkspace
    scheme: yourProjectName

To generate the environment variable below is the guide:
The build action will need the following variables to be added as Github Secrets:

IOS_MOBILE_PROVISION_BASE64 : Base64 encoded Provisioning profile file.

Download it from your Apple developer portal and use the following script to generate base64 encoded format.

openssl base64 < MY_Profile.mobileprovision | tr -d '\n' | tee my-profile.base64.txt 

IOS_P12_BASE64 : Base64 encoded .p12 file (key + cert)
After installing the certificate on your Mac, Open Keychain Access App, select "My Certificates" on the top, and locate the certificate you've downloaded.

Expand the certificate to see the corresponding private key. Then select the certificate and private key, then right-click for the context menu on the items and choose "Export 2 items…".

Pick a location on disk to save the file as a .p12 and choose a strong password for the file(IOS_CERTIFICATE_PASSWORD)

Generate a base64 for the .p12 file using

 openssl base64 < cert.p12 | tr -d '\n' | tee cert.base64.txt 

IOS_TEAM_ID : your apple team id https://developer.apple.com/account/#!/membership/

IOS_CERTIFICATE_PASSWORD : Password used to generate p2 certificate.

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

3 participants