yukiarrr / ios-build-action

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

No provisioning profile provided #26

Closed zhouxinwei97 closed 4 years ago

zhouxinwei97 commented 4 years ago

Hi yukiarr, thanks for the build action. I am relatively new to ios deployment so I was wondering if you can help me on this.

I can manually archive and upload my project from my local mac to testflight and now i am trying to automate this process once i push a new update to a branch in my github repo

I have been trying to build a unity project for ios with webbertakken's action and that was successful, following that, i want to build the xcodeproj and deploy onto testflight. I have supplied all the relevant information as per your READme.md but i kept on getting a "No provisioning profile provided" error.

I generated the base64 profile and p12 cert on my local mac machine with the command

base64 xxx.mobileprovision >> mobileprovision.out base64 certificate.p12 >> certificate.out

and copy pasting the output to the secrets in github, the attached screenshots are the error and the github actions yml. Do let me know if you need anything else, thank you so much!

Screenshot 2020-10-13 at 11 23 30 PM


on:
  push:
    branches:
      - 20200820--CI-Integration

env:
  UNITY_LICENSE: ${{ secrets.UNITY_LICENSE_2019_3_9 }}
  P12_BASE64: ${{ secrets.P12_BASE64 }}  
  MOBILEPROVISION_BASE64: ${{ secrets.MOBILEPROVISION_BASE64 }} 
  CODE_SIGNING_IDENTITY: ${{ secrets.CODE_SIGNING_IDENTITY }}
  TEAM_ID: ${{ secrets.TEAM_ID }}

jobs:
  build:
    name: Build my project
    runs-on: ubuntu-latest
    steps:
     # Checkout
      - name: Checkout repository
        uses: actions/checkout@v2
        with:
          lfs: true

     # Build
      - name: Build project
        uses: webbertakken/unity-builder@v1.1
        with:
          unityVersion: 2019.3.9f1
          targetPlatform: iOS

     # Output
      - uses: actions/upload-artifact@v2
        with:
          name: Build
          path: build

  deploy:
    needs: build
    name: Deploy project
    runs-on: macos-latest
    env:
      BUILDS_PATH: ${{ format('{0}/build', github.workspace) }}
    steps:
      - uses: actions/checkout@v2
        with:
          lfs: true

      - name: Download artifact
        uses: actions/download-artifact@v2
        with:
          name: Build
          path: build

      - name: Changing permission
        run: |
          find $BUILDS_PATH -type f -iname "*.sh" -exec chmod +x {} \;

      - uses: yukiarrr/ios-build-action@v1.2.0
        with:
          project-path: ./build/iOS/iOS/Unity-iPhone.xcodeproj
          p12-base64: ${{ secrets.P12_BASE64 }}
          mobileprovision-base64: ${{ secrets.MOBILEPROVISION_BASE64 }}
          code-signing-identity: ${{ secrets.CODE_SIGNING_IDENTITY }}
          team-id: ${{ secrets.TEAM_ID }}
yukiarrr commented 4 years ago

@zhouxinwei97 Thanks for creating the Issue! Do you get an error if add disable-targets?

...
  with:
      project-path: ./build/iOS/iOS/Unity-iPhone.xcodeproj
      p12-base64: ${{ secrets.P12_BASE64 }}
      mobileprovision-base64: ${{ secrets.MOBILEPROVISION_BASE64 }}
      code-signing-identity: ${{ secrets.CODE_SIGNING_IDENTITY }}
      team-id: ${{ secrets.TEAM_ID }}
+     disable-targets: "Unity-iPhone"
zhouxinwei97 commented 4 years ago

Hi yukiarr, thanks for the reply, I have just tried adding the disable-targets but still receive the same error.

Is there some settings I have to do on unity's player setting side? I have unticked automatically signing on unity and added the mobileprovision file i used as the provision file.

yukiarrr commented 4 years ago

Thanks for checking!

I have unticked automatically signing on unity and added the mobileprovision file i used as the provision file.

I see. Can you tick Automatically Sign without specifying provisioning profile directly in Unity, and then run CI again?

zhouxinwei97 commented 4 years ago

Yeap, still facing the same issue when i enabled automatic signing on unity player settings

yukiarrr commented 4 years ago

I see... Is it possible to build iOS on local PC using provisioning profile you have set up? And, Can you show me all the logs of ios-build-action as I want to investigate the cause?

zhouxinwei97 commented 4 years ago

Yes, I am able to build iOS on my local PC and upload it to testflight from xcode.

Attached is the logs for the build actions, do let me know if you need anything else, thanks! 5_Run yukiarrrios-build-action@v1.2.0.txt

yukiarrr commented 4 years ago

@zhouxinwei97 Thanks for all logs! Sorry, this was an issue that was happening on the Action side. (PR for details) I just merged the fixed PR and released it as v1.3.0. Can you try with uses: yukiarrr/ios-build-action@v1.3.0?

zhouxinwei97 commented 4 years ago

Hi yukiar, thanks for the fix and the wonderful ios-builder actions, it works perfectly now! I am able to get a successful build to output.ipa.

Just a side question, now that I am able to build to output.ipa, I would need to write a new job to upload this .ipa to testflight right?

yukiarrr commented 4 years ago

Good, thanks for checking! Because ios-build-action is the Action that builds iOS project and exports ipa, it is recommended that you use upload-testflight-build and others to upload to TestFlight.

zhouxinwei97 commented 4 years ago

okay thank you so much once again for the help!

yukiarrr commented 4 years ago

Thanks to you too, the issue has been fixed!