Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support publishing to Snapcraft #3187

Closed
sindresorhus opened this issue Jul 29, 2018 · 15 comments
Closed

Support publishing to Snapcraft #3187

sindresorhus opened this issue Jul 29, 2018 · 15 comments

Comments

@sindresorhus
Copy link

  • Version: 20.26.0
  • Target: Snap

electron-builder has a snap target, but it seems we still need to manually upload the binary using snapcraft push dist/appname_2.16.0_amd64.snap and then snapcraft release appname 1 stable. Would be nice if electron-builder could handle the publish-step too.

More info: https://docs.snapcraft.io/build-snaps/publish

@develar
Copy link
Member

develar commented Jul 29, 2018

What is your development OS?

@sindresorhus
Copy link
Author

macOS (both dev and on Travis)

@sindresorhus
Copy link
Author

snapcraft is on Homebrew.

@develar
Copy link
Member

develar commented Jul 29, 2018

is on Homebrew

But it anyway we cannot require to install since it doesn't conform to our standards. Should be one-click experience, without tons of docs and "instal foo and bar".

Ok, I will investigate.

@sindresorhus
Copy link
Author

But it anyway we cannot require to install since it doesn't conform to our standards.

You already require installing rpm through Homebrew:

To build rpm: brew install rpm (brew). - https://www.electron.build/multi-platform-build/#macos

But yes, I agree, it would be much nicer without this manual step.

@develar
Copy link
Member

develar commented Jul 29, 2018

rpm is not default target for Linux. And not popular (and you can set _REMOTE_BUILD=true to avoid installing).

@evandandrea
Copy link

@develar do you have suggestions on how we could distribute snapcraft for Mac such that electron-builder could handle publishing?

/cc @sergiusens @kyrofa

I love this idea. We're seeing quite a few instances of people publishing .snap files to GitHub releases. That doesn't give you the showcasing to the millions of Snap Store users, doesn't give you auto-updates, and requires trust (snap install --dangerous). This would solve all of that.

@evandandrea
Copy link

Alternatively, we could write a handler in JavaScript, as was done in Ruby for Travis:

@develar
Copy link
Member

develar commented Jul 10, 2019

Python is not a good language for CLI tools (the same as NodeJS ;)), but at least now snapcraft is available for macOS. I cannot find easily instructions how to install it on Windows without Linux subsystem.

electron-builder 21 forces you to publish to store. A new publish provider snapStore is the default value for snap and your regular publish configuration is ignored unless explicitly specified for snap (under key snap).

electron build service cannot be used to publish snap for poor Windows users, who cannot migrate to a normal OS, because I don't want to take responsibility for credentials. Maybe later electron-builder will produce a special plugin for snapcraft, so, you will be able to use official build service from Canonical to build and publish your snap. I cannot predict when it will be implemented and will be implemented or not.

I like how snapcrat is developer friendly (shame on you, bloody Apple and not so bloody but still, MS).

snapcrat push produces correct and clear error messages, so, electron-builder is not forced to add another layer of error handling.

It will be released in 2 days.

@develar
Copy link
Member

develar commented Jul 10, 2019

electron-builder 21 forces you to publish to store

To make clear why — because snap is awesome. electron-builder goal is simple — you want just release your snap and that's all. Focus on your app development. Not to mix your sexual life and programming. So, even if big commercial companies allocate time to verify that app works in varios Linux distros (and should do it for obvious reasons), it is not an option for a lot of developers. And contradicts to what electron-builder promises.

So, snap and publishing to snap store is strongly recommended. It is the only format that will just works in 99% (no even glibc dependency).

@sindresorhus
Copy link
Author

@develar Awesome. And I totally agree with that thinking.

@jtc42
Copy link

jtc42 commented Jul 14, 2019

So am I right in thinking that we can set publish to first - a generic server, providing auto-updates for Windows (edit: and existing AppImage) installs, and second - SnapCraft, which will allow auto-updates on Linux via SnapCraft, rather than integrated auto-updates? Or will this cause problems?

develar added a commit that referenced this issue Jul 23, 2019
@patarapolw
Copy link

patarapolw commented May 13, 2020

So, how do I DISABLE publishing to SnapCraft. My build kept crashing...

Install the review-tools from the Snap Store for enhanced checks before uploading this snap.
You are required to login before continuing.
Enter your Ubuntu One e-mail address and password.
If you do not have an Ubuntu One account, you can create one at https://snapcraft.io/account
Authentication error: Failed to get unbound discharge: Invalid request data
  ⨯ exit status 2
github.com/develar/app-builder/pkg/util.ExecuteAndPipeStdOutAndStdErr
	/Volumes/data/Documents/app-builder/pkg/util/exec.go:23
github.com/develar/app-builder/pkg/package-format/snap.publishToStore
	/Volumes/data/Documents/app-builder/pkg/package-format/snap/snapStore.go:35
github.com/develar/app-builder/pkg/package-format/snap.ConfigurePublishCommand.func1
	/Volumes/data/Documents/app-builder/pkg/package-format/snap/snapStore.go:18
github.com/alecthomas/kingpin.(*actionMixin).applyActions
	/Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/actions.go:28
github.com/alecthomas/kingpin.(*Application).applyActions
	/Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:557
github.com/alecthomas/kingpin.(*Application).execute
	/Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:390
github.com/alecthomas/kingpin.(*Application).Parse
	/Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:222
main.main
	/Volumes/data/Documents/app-builder/main.go:90
runtime.main
	/usr/local/Cellar/go/1.14.2_1/libexec/src/runtime/proc.go:203
runtime.goexit
	/usr/local/Cellar/go/1.14.2_1/libexec/src/runtime/asm_amd64.s:1373  
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! e-rep2recall@0.3.1 build: `electron-builder -p always`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the e-rep2recall@0.3.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/travis/.npm/_logs/2020-05-13T04_49_27_000Z-debug.log

@sergiusens
Copy link
Contributor

@patarapolw a new issue might be better here, but I suspect your login credentials expired.

@rasgo-cc
Copy link

Quoting @adam-lynch , on issue #4982, you can disable it by providing a generic provider:

You can also set snap.publish to:
{
provider: "generic",
url: "https://anydummyurl.com"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants