samuelmeuli / action-electron-builder

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

Linux build fails #67

Closed konsumer closed 3 years ago

konsumer commented 3 years ago

Here is my example app.


Building and releasing the Electron app…
  • electron-builder  version=22.11.7 os=5.8.0-1039-azure
  • loaded configuration  file=package.json ("build" field)
  • rebuilding native dependencies  dependencies=@serialport/bindings@9.2.0 platform=linux arch=x64
  • install prebuilt binary  name=@serialport/bindings version=9.2.0 platform=linux arch=x64 napi=
  • packaging       platform=linux arch=x64 electron=13.1.7 appOutDir=dist/linux-unpacked
  • building        target=snap arch=x64 file=dist/mindgraph_0.0.10_amd64.snap
  • building        target=AppImage arch=x64 file=dist/mindgraph-0.0.10.AppImage
  • application Linux category is set to default "Utility"  reason=linux.category is not set and cannot map from macOS docs=https://www.electron.build/configuration/linux
  • default Electron icon is used  reason=application icon is not set
  • application Linux category is set to default "Utility"  reason=linux.category is not set and cannot map from macOS docs=https://www.electron.build/configuration/linux
  • publishing      publisher=Github (owner: brainbang, project: mindgraph, version: 0.0.10)
  • uploading       file=mindgraph-0.0.10.AppImage provider=GitHub
  • publishing      publisher=Snap Store
  • uploading       file=mindgraph_0.0.10_amd64.snap provider=snapStore
  ⨯ snapcraft is not installed, please: sudo snap install snapcraft --classic  
  ⨯ Cannot cleanup: 

Error #1 --------------------------------------------------------------------------------
Error: /home/runner/work/mindgraph/mindgraph/node_modules/app-builder-bin/linux/x64/app-builder exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
    at ChildProcess.<anonymous> (/home/runner/work/mindgraph/mindgraph/node_modules/builder-util/src/util.ts:249:14)
    at Object.onceWrapper (node:events:514:26)
    at ChildProcess.emit (node:events:394:28)
    at maybeClose (node:internal/child_process:1067:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)

Error #2 --------------------------------------------------------------------------------
Error: socket hang up
    at connResetException (node:internal/errors:691:14)
    at TLSSocket.socketOnEnd (node:_http_client:471:23)
    at TLSSocket.emit (node:events:406:35)
    at endReadableNT (node:internal/streams/readable:1331:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)  failedTask=build stackTrace=Error: Cannot cleanup: 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Error #1 --------------------------------------------------------------------------------
Error: /home/runner/work/mindgraph/mindgraph/node_modules/app-builder-bin/linux/x64/app-builder exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
    at ChildProcess.<anonymous> (/home/runner/work/mindgraph/mindgraph/node_modules/builder-util/src/util.ts:249:14)
    at Object.onceWrapper (node:events:514:26)
    at ChildProcess.emit (node:events:394:28)
    at maybeClose (node:internal/child_process:1067:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Error #2 --------------------------------------------------------------------------------
Error: socket hang up
    at connResetException (node:internal/errors:691:14)
    at TLSSocket.socketOnEnd (node:_http_client:471:23)
    at TLSSocket.emit (node:events:406:35)
    at endReadableNT (node:internal/streams/readable:1331:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
    at throwError (/home/runner/work/mindgraph/mindgraph/node_modules/builder-util/src/asyncTaskManager.ts:88:11)
    at checkErrors (/home/runner/work/mindgraph/mindgraph/node_modules/builder-util/src/asyncTaskManager.ts:53:9)
    at AsyncTaskManager.awaitTasks (/home/runner/work/mindgraph/mindgraph/node_modules/builder-util/src/asyncTaskManager.ts:67:7)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at PublishManager.awaitTasks (/home/runner/work/mindgraph/mindgraph/node_modules/app-builder-lib/src/publish/PublishManager.ts:228:5)
    at Object.executeFinally (/home/runner/work/mindgraph/mindgraph/node_modules/builder-util/src/promise.ts:23:3)
/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: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 1785,
  stdout: null,
  stderr: null
}```
scope2229 commented 3 years ago

Of you look at the error at the top you need to install snapcraft and login. Or you need to define build parametters for Linux that does not produce a build for snapcraft.

"build": { "Linux": { "target": "AppImage" } }

konsumer commented 3 years ago

Thanks! I ended up using electron-packager and my own options, as I don't want to build/publish for snapcraft, I just want regular builds for each target.

This is working pretty well for me, which creates a release, builds with electron-packager for each platform, zips them, and attaches to the release.

konsumer commented 3 years ago

I might circle-back and use your suggestion when I have a bit more time to mess with it, as I like the more complete builds (DMG for mac, etc.)

lostdesign commented 3 years ago

@scope2229 any insight on how you add snapcraft to the process?

scope2229 commented 3 years ago

@lostdesign you'll want to add snapcraft-action https://github.com/marketplace/actions/snapcraft-action, Provide your login details as github secrets and add them to ENV for easier access. once that is done it should run successfully.