yukiarrr / ios-build-action

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

mobileprovision-base64 with multiple profiles doesn't work? #113

Open kellybyrd opened 1 year ago

kellybyrd commented 1 year ago

I have an iOS app with several embedded extensions. In GitHub secrets, I have MY_PROVISION_PROFILE_1_BASE64, MY_PROVISION_PROFILE_2_BASE64, MY_PROVISION_PROFILE_3_BASE64, MY_PROVISION_PROFILE_4_BASE64

When I use mobileprovision-base64: ${{ secrets.MY_PROVISION_PROFILE_1_BASE64 }} The section of the Action is fine:

[01:17:19]: ------------------------------------------
[01:17:19]: --- Step: install_provisioning_profile ---
[01:17:19]: ------------------------------------------
[01:17:19]: Installing provisioning profile...

But of course the build fails later because I don't have provisioning profiles for all the bundle ids. The above is true if I use any profile 1-4, as long as a I use only one at a time.

When I try more than one

mobileprovision-base64: |
            ${{ secrets.MY_PROVISION_PROFILE_1_BASE64 }}
            ${{ secrets.MY_PROVISION_PROFILE_3_BASE64 }}

the Action fails early with this:

[01:22:46]: ------------------------------------------
[01:22:46]: --- Step: install_provisioning_profile ---
[01:22:46]: ------------------------------------------
[01:22:46]: Installing provisioning profile...
[01:22:46]: ------------------------------------------
[01:22:46]: --- Step: install_provisioning_profile ---
[01:22:46]: ------------------------------------------
[01:22:46]: Installing provisioning profile...
[01:22:46]: Failure to decode /Users/runner/work/IOS/IOS/ios-build-2.mobileprovision. Exit: 1: security: failed to decode message: UNKNOWN (-8183(d)
security: problem decoding

+---------------------------+-----------------------------------------------------+
|                                  Lane Context                                   |
+---------------------------+-----------------------------------------------------+
| DEFAULT_PLATFORM          | ios                                                 |
| PLATFORM_NAME             | ios                                                 |
| LANE_NAME                 | ios export_ipa                                      |
| KEYCHAIN_PATH             | ~/Library/Keychains/ios-build.keychain              |
| ORIGINAL_DEFAULT_KEYCHAIN | "/Users/runner/Library/Keychains/login.keychain-db" |
+---------------------------+-----------------------------------------------------+
[01:22:46]: Error parsing provisioning profile at path '/Users/runner/work/IOS/IOS/ios-build-2.mobileprovision'

I have tried each of the individual profiles (they all pass this install_provisioning_profile step). I have tried many combinations of the various profiles together and I have not gotten any of them to work.

Do I understand this wrong? What can I do?

kellybyrd commented 1 year ago

Update: I ended up using MobileDevOps/secret-to-file-action@v1.0.0 to turn the base64 .mobileprovision secrets into files, then I was able to use

mobileprovision-path : |
            ./tmp/App.mobileprovision
            ./tmp/Ext1.mobileprovision
            ./tmp/Ext2.mobileprovision
            ./tmp/Ext3.mobileprovision

and it appears to be working.

So, either I don't understand how the mobileprovision-base64 option is supposed to work with multiple secrets, or it doesn't actually work correctly.

blueish9 commented 1 year ago

hi @kellybyrd, I had the same problem with mobileprovision-base64. Here's what I did to resolve it: