tauri-apps / tauri-action

Build your Web application as a Tauri binary for macOS, Linux and Windows
https://tauri.app
MIT License
888 stars 147 forks source link

Notarization failing #765

Closed RossLote closed 5 months ago

RossLote commented 5 months ago

Getting this:

  Bundling Spark.app (/Users/runner/work/spark-offline/spark-offline/src-tauri/target/release/bundle/macos/Spark.app)
     Signing with identity "***"
        Info setup keychain from environment variables...
        Info Signing app bundle...
     Signing /Users/runner/work/spark-offline/spark-offline/src-tauri/target/release/bundle/macos/Spark.app/Contents/MacOS/Spark
     Signing /Users/runner/work/spark-offline/spark-offline/src-tauri/target/release/bundle/macos/Spark.app
     Signing with identity "***"
        Info setup keychain from environment variables...
        Info Signing app bundle...
     Signing /var/folders/n2/pt_35rc53tdgkld9531s2tfh0000gn/T/.tmp58gk3e/Spark.zip
  Notarizing /Users/runner/work/spark-offline/spark-offline/src-tauri/target/release/bundle/macos/Spark.app
       Error failed to bundle project: failed to upload app to Apple's notarization servers.

Workflow file looks like this:

      - name: Build the app
        uses: tauri-apps/tauri-action@v0

        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
          APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
          APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
          APPLE_ID: ${{ secrets.APPLE_ID }}
          APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
          APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
        with:
          ...

The error message is too generic so I don't even know where to go.

Is it possible the the signing is wrong or would the error be different?

FabianLars commented 5 months ago

can you try setting args: --verbose on the tauri-action step and see if that gives you a better message?

RossLote commented 5 months ago

Getting

     Running [tauri_bundler::bundle::common] Command `xcrun  notarytool submit /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/.tmpZsh8Hk/Spark.zip --wait --output-format json --apple-id *** --password *** --team-id ***`
Error: HTTP status code: 401. Unable to authenticate. Invalid session. Ensure that all authentication arguments are correct.
       Error [tauri_cli_node] failed to bundle project: failed to upload app to Apple's notarization servers.

I've tried to run this locally but it still fails.

I'm going to try the APPLE_API_KEY_PATH method but I'm a little confused about where to put the file with the key. What is this path relative to? Am I supposed to include the file in my repo? I don't much like the sound of that.

RossLote commented 5 months ago

I'm going to close this as I managed to get it working with the API instead. I really don't know whey the other method didn't work though.

kieranm commented 2 weeks ago

@RossLote Did you use APPLE_API_KEY_PATH? How did you make a file containing the key available in CI? Thanks!

RossLote commented 2 weeks ago

@kieranm I added this before the build step:

  - name: Create .p8 file
    run: |
      mkdir -p ~/.appstoreconnect/private_keys
      echo "${{ secrets.APPLE_API_KEY_CONTENT }}" > ~/.appstoreconnect/private_keys/AuthKey_${{ secrets.APPLE_API_KEY }}.p8
RossLote commented 2 weeks ago

The file location is the default path so I don't need to set it.