samuelmeuli / action-electron-builder

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

Electron Builder Script not working #52

Open kavinvalli opened 3 years ago

kavinvalli commented 3 years ago

Hi. I am getting this error in the workflow

Building and releasing the Electron app…
not found: electron-builder
/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:144
                throw err;
                ^

Error: Command failed: npx --no-install electron-builder --linux --publish always 
    at checkExecSyncError (child_process.js:621:11)
    at execSync (child_process.js:657:15)
    at run (/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:21:27)
    at runAction (/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:132:4)
    at Object.<anonymous> (/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:150:1)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) {
  status: 127,
  signal: null,
  output: [ null, null, null ],
  pid: 2511,
  stdout: null,
  stderr: null
}

Should I add it in my dependencies?

pigLoveRabbit520 commented 3 years ago

same error, anyone advice?

mkurczewski commented 3 years ago

Same for me 😞

boyphongsakorn commented 3 years ago

Same for me too

boyphongsakorn commented 3 years ago

i add

- run: npm install electron-builder --save-dev

in build.yml it's work but error from postInstall -_-

ThomasReyskens commented 3 years ago

I fixed it by moving the electron dependency to devDeps (I still think that it is not this library to decide where the dep. should be..) And adding an extra env option:

env:
  NODE_OPTIONS: '--max_old_space_size=4096'
kaiserdj commented 3 years ago

I fixed it by moving the electron dependency to devDeps (I still think that it is not this library to decide where the dep. should be..) And adding an extra env option:

env:
  NODE_OPTIONS: '--max_old_space_size=4096'

I did not understand very well, I have the same problem but I do not have much knowledge of Actions. 😢

ransome1 commented 3 years ago

i add

- run: npm install electron-builder --save-dev

in build.yml it's work but error from postInstall -_-

Having the same error, but this did not solve the problem. Did anybody find another approach?

julian-alarcon commented 3 years ago

You could add the environment variables in the workflow yaml file. This is an example:

      - name: Build/release Electron app
        uses: samuelmeuli/action-electron-builder@v1
        with:
          # GitHub token, automatically provided to the action
          # (No need to define this secret in the repo settings)
          github_token: ${{ secrets.github_token }}

          # If the commit is tagged with a version (e.g. "v1.0.0"),
          # release the app after building
          release: ${{ startsWith(github.ref, 'refs/tags/v') }}
        env:
          NODE_OPTIONS: '--max_old_space_size=4096'

I was getting a similar error, but after checking a little closer, I was trying to build pacman packages but with the current runner, it seems that Github changed the default runner to Ubuntu 20.04 a few months ago https://github.blog/changelog/2020-10-29-github-actions-ubuntu-latest-workflows-will-use-ubuntu-20-04/

This is causing some errors related with the missing binary bsdtar used by the pacman builder. I found this workaround https://github.com/electron-userland/electron-builder/issues/4181 . Just install libarchive-tools for the runner.

Can you try this? This is a reported error https://github.com/samuelmeuli/action-electron-builder/issues/42