yukiarrr / ios-build-action

Build iOS project (.xcodeproj, .xcworkspace), and export ipa
MIT License
279 stars 135 forks source link

security: SecKeychainItemImport: Unknown format in import. #80

Open amjedsaleel opened 2 years ago

amjedsaleel commented 2 years ago

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

- uses: yukiarrr/ios-build-action@v1.5.0
  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 commented 2 years ago

Any solution?n

amjedsaleel commented 2 years ago

@HunainHumail still not get any solutions

peterchege commented 2 years ago

@amjedsaleel

edit with this format and try:

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.