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

Shell command exited with exit status 127 instead of 0. #12

Closed
Sl3dge78 opened this issue Aug 13, 2020 · 4 comments
Closed

Shell command exited with exit status 127 instead of 0. #12

Sl3dge78 opened this issue Aug 13, 2020 · 4 comments

Comments

@Sl3dge78
Copy link
Contributor

Sl3dge78 commented Aug 13, 2020

Thank you for the action.
I'm having an issue, maybe you'll be able to help :

I use https://github.com/webbertakken/unity-builder to generate an iOs version of my project
then use your action to upload it to app store connect but get this error message :
Shell command exited with exit status 127 instead of 0.

Here's the full log

Any idea why it fails?
Thanks!

@yukiarrr
Copy link
Owner

Thanks for creating the Issue!
I have one question.
Which VMs are your workflows running on?(Linux, Mac, Windows, etc...)
I'd like to see your yaml.

@Sl3dge78
Copy link
Contributor Author

Here's the full thing

jobs:
  build-ios:
    name : Build IOS
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        targetPlatform:
          - iOS
    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
        
    # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
    - uses: actions/checkout@v2
      with:
        lfs: true
    
    - uses: actions/cache@v1.1.0
      with:
          path: Library
          key: Library-${{ matrix.targetPlatform }}
          restore-keys: | 
            Library-${{ matrix.targetPlatform }}
            Library
            
    - uses: webbertakken/unity-builder@v1.1
      with:
          unityVersion: ${{ env.UNITY_VERSION }}
          targetPlatform: ${{ matrix.targetPlatform }}
          versioning : Semantic 
   
    - uses: yukiarrr/ios-build-action@v1.1.0
      with:
          project-path: build\iOS\iOS\Unity-iPhone.xcodeproj
          p12-base64: ${{ secrets.P12_BASE64 }}
          mobileprovision-base64: ${{ secrets.MOBILEPROVISION_BASE64 }}
          code-signing-identity: iOS Distribution
          certificate-password: ${{ secrets.P12_PASSWORD }}
          team-id: ${{ secrets.TEAM_ID }}

So running on ubuntu. I'll try on mac.

@yukiarrr
Copy link
Owner

yukiarrr commented Aug 14, 2020

Thanks!
That workflow runs on Linux, but can run iOS build only on Mac.
That's why you're getting an error.
However, if you change the VM to Mac, this time you get an error because Unity Builder cannot run on Mac.
There are two solutions to this problem.

Split the job into Linux and Mac job

This is a method to run Unity build on Linux and iOS build on Mac.
In this case, you need to use Artifacts to pass files between jobs. (See here for details)
Note that Artifacts also has an upload limit.

jobs:
  build-unity:
    name : Build Unity
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        targetPlatform:
          - iOS
    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:

    # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
    - uses: actions/checkout@v2
      with:
        lfs: true

    - uses: actions/cache@v1.1.0
      with:
          path: Library
          key: Library-${{ matrix.targetPlatform }}
          restore-keys: |
            Library-${{ matrix.targetPlatform }}
            Library

    - uses: webbertakken/unity-builder@v1.1
      with:
          unityVersion: ${{ env.UNITY_VERSION }}
          targetPlatform: ${{ matrix.targetPlatform }}
          versioning : Semantic

    - uses: actions/upload-artifact@v2
      with:
        name: my-artifact
        path: path/to/artifact

  build-ios:
    name : Build iOS
    runs-on: macos-latest
    needs: build-unity
    steps:

    - uses: actions/download-artifact@v2
      with:
        name: my-artifact
        path: path/to/artifact

    - uses: yukiarrr/ios-build-action@v1.1.0
      with:
          project-path: build\iOS\iOS\Unity-iPhone.xcodeproj
          p12-base64: ${{ secrets.P12_BASE64 }}
          mobileprovision-base64: ${{ secrets.MOBILEPROVISION_BASE64 }}
          code-signing-identity: iOS Distribution
          certificate-password: ${{ secrets.P12_PASSWORD }}
          team-id: ${{ secrets.TEAM_ID }}

Using unity-build-action instead of Unity Builder

Unity Builder cannot run on Mac, but unity-build-action can build on Linux, Mac, Windows, and self-hosted.
Therefore, you can run Unity build and iOS build on the same job on Mac.

jobs:
  build-ios:
    name : Build IOS
    runs-on: macos-latest
    strategy:
      fail-fast: false
      matrix:
        targetPlatform:
          - iOS
    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:

    # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
    - uses: actions/checkout@v2
      with:
        lfs: true

    - uses: actions/cache@v1.1.0
      with:
          path: Library
          key: Library-${{ matrix.targetPlatform }}
          restore-keys: |
            Library-${{ matrix.targetPlatform }}
            Library

    - uses: yukiarrr/unity-build-action@v0.6.0
      with:
          unity-version: ${{ env.UNITY_VERSION }}
          unity-username: ${{ secrets.UNITY_USERNAME }}
          unity-password: ${{ secrets.UNITY_PASSWORD }}
          unity-serial: ${{ secrets.UNITY_SERIAL }}
          build-target: ${{ matrix.targetPlatform }}

    - uses: yukiarrr/ios-build-action@v1.1.0
      with:
          project-path: Output/Unity-iPhone.xcodeproj
          p12-base64: ${{ secrets.P12_BASE64 }}
          mobileprovision-base64: ${{ secrets.MOBILEPROVISION_BASE64 }}
          code-signing-identity: iOS Distribution
          certificate-password: ${{ secrets.P12_PASSWORD }}
          team-id: ${{ secrets.TEAM_ID }}

Note that both methods use Mac, which consumes a lot of available time in GitHub Actions.
So if you're going to be using it for a long time, you may want to run it on self-hosted.

@Sl3dge78
Copy link
Contributor Author

Thank you very much for the detailed answer.
Maybe you could add this info to the readme to prevent future users from making the same assumption as me?

I'll try both options and see which one works best for me, cheers!

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

2 participants