samuelmeuli / action-electron-builder

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

Disabling publishing to Snapcraft #15

Closed yafp closed 4 years ago

yafp commented 4 years ago

I was building my electron app locally & manually in the past using electron builder. This produced a .snap file without issues which i was able to release via github releases.

Recently i switched to use your action to build directly on github.

The snap building part seems to fail because it it trying to release the app to snapcraft - which i basically don't event need.


2020-02-27T21:15:53.3000452Z   • publishing      publisher=Snap Store
2020-02-27T21:15:53.3001796Z   • uploading       file=media-dupes-0.5.20200227-linux-amd64.snap provider=snapStore
2020-02-27T21:15:56.1677832Z Preparing to push 'media-dupes-0.5.20200227-linux-amd64.snap'.
2020-02-27T21:15:56.1679530Z After pushing, the resulting snap revision will be released to 'edge' when it passes the Snap Store review.
2020-02-27T21:15:56.1680847Z Install the review-tools from the Snap Store for enhanced checks before uploading this snap.
2020-02-27T21:15:56.2256861Z You are required to login before continuing.
2020-02-27T21:15:56.2258538Z Enter your Ubuntu One e-mail address and password.
2020-02-27T21:15:56.2260891Z If you do not have an Ubuntu One account, you can create one at https://snapcraft.io/account
2020-02-27T21:15:57.0601847Z Authentication error: Failed to get unbound discharge: Invalid request data
2020-02-27T21:15:57.1236900Z   ⨯ exit status 2
2020-02-27T21:15:57.1249849Z github.com/develar/app-builder/pkg/util.ExecuteAndPipeStdOutAndStdErr
2020-02-27T21:15:57.1251260Z    /Volumes/data/Documents/app-builder/pkg/util/exec.go:23
2020-02-27T21:15:57.1252312Z github.com/develar/app-builder/pkg/package-format/snap.publishToStore
2020-02-27T21:15:57.1253373Z    /Volumes/data/Documents/app-builder/pkg/package-format/snap/snapStore.go:35
2020-02-27T21:15:57.1254889Z github.com/develar/app-builder/pkg/package-format/snap.ConfigurePublishCommand.func1
2020-02-27T21:15:57.1256023Z    /Volumes/data/Documents/app-builder/pkg/package-format/snap/snapStore.go:18
2020-02-27T21:15:57.1256880Z github.com/alecthomas/kingpin.(*actionMixin).applyActions
2020-02-27T21:15:57.1257749Z    /Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/actions.go:28
2020-02-27T21:15:57.1258607Z github.com/alecthomas/kingpin.(*Application).applyActions
2020-02-27T21:15:57.1259424Z    /Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:557
2020-02-27T21:15:57.1260276Z github.com/alecthomas/kingpin.(*Application).execute
2020-02-27T21:15:57.1261082Z    /Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:390
2020-02-27T21:15:57.1261930Z github.com/alecthomas/kingpin.(*Application).Parse
2020-02-27T21:15:57.1262744Z    /Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:222
2020-02-27T21:15:57.1263504Z main.main
2020-02-27T21:15:57.1264392Z    /Volumes/data/Documents/app-builder/main.go:90
2020-02-27T21:15:57.1265081Z runtime.main
2020-02-27T21:15:57.1265766Z    /usr/local/Cellar/go/1.13.6/libexec/src/runtime/proc.go:203
2020-02-27T21:15:57.1266466Z runtime.goexit
2020-02-27T21:15:57.1267149Z    /usr/local/Cellar/go/1.13.6/libexec/src/runtime/asm_amd64.s:1357  
2020-02-27T21:16:23.6333074Z   • building        target=deb arch=x64 file=dist/media-dupes-0.5.20200227-linux-amd64.deb

is it possible with your action to just build .snap and publish it to github releases like it is working for any other build (i.e. .deb / .AppImage etc)?

If so - how?

samuelmeuli commented 4 years ago

You'll need to configure electron-builder to stop publishing to Snapcraft. Please see their docs or issue tracker for this.

If you do want to publish to Snapcraft, have a look at this section in the README.

yafp commented 4 years ago

@samuelmeuli Thanks for your answer.

According to the electron-builder documention it might help to use the cli parameter -c.snap.publish=github.

You can also configure publishing using CLI arguments, for example, to force publishing snap not to Snap Store, but to GitHub: -c.snap.publish=github

As far as i understand i would need to add this parameter to my package.json script for the linux build.

I am wondering how does your action know which script of the package.json file script section is has to execute - based on the current platform?

samuelmeuli commented 4 years ago

Config parsing is done by electron-builder, not this action. All the action does is run the electron-builder command with the correponding platform flag and set some environment variables.