samuelmeuli / action-electron-builder

:electron: GitHub Action for building and releasing Electron apps
MIT License
670 stars 206 forks source link

ERROR: The "data" argument must be of type string or ... #84

Closed andyoknen closed 2 years ago

andyoknen commented 2 years ago

This problem only shows up if I use GitHub Actions I have now checked the build according to the instructions from this repository - everything works Maybe the problem is not here - but I hope for help, because I can't find a solution yet. Thanks!

Start notarizing app.custom.name found at ...
  ⨯ The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Error  failedTask=build stackTrace=TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Error

I followed these instructions https://github.com/samuelmeuli/action-electron-builder#notarization https://samuelmeuli.com/blog/2019-12-28-notarizing-your-electron-app

My build.yml:

name: Build App

on:
  push:
    #tags: v*.*.*

jobs:
  release:
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        os: [macos-latest] # , ubuntu-latest, windows-latest

    steps:
      - name: Check out Git repository
        uses: actions/checkout@v1

      - name: Install Node.js, NPM and Yarn
        uses: actions/setup-node@v1
        with:
          node-version: 14

      - name: Prepare for app notarization
        if: startsWith(matrix.os, 'macos')
        run: |
          mkdir -p ~/private_keys/
          echo '${{ secrets.APPLE_API_KEY }}' > ~/private_keys/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8

      - name: Build/release Electron app
        uses: samuelmeuli/action-electron-builder@v1
        with:
          github_token: ${{ secrets.release_token }}
          release: ${{ startsWith(github.ref, 'refs/tags/v') }}
          mac_certs: ${{ secrets.mac_certs }}
          mac_certs_password: ${{ secrets.mac_certs_password }}
        env:
          # TEAM_SHORT_NAME: ${{ secrets.apple_team_short_name }}
          # APPLE_ID: ${{ secrets.apple_id }}
          # APPLE_ID_PASSWORD: ${{ secrets.apple_id_password }}
          API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
          API_KEY_ISSUER_ID: ${{ secrets.APPLE_API_KEY_ISSUER_ID }}
andyoknen commented 2 years ago

I think I solved the problem - I used the wrong certificate