Snap on the snap store
Closed this issue · 20 comments
Hi,
Can you post the snap on the snap store, so that we have automatic updates ?
Please, asking for a friend ;)
Best Regards
You should get automatic updates as is.
I'm using the Electron builder updater's checkForUpdatesAndNotify()
for that, which pulls the new release directly from GitHub. Let me know if there are issues with that. But it makes it very easy for me to draft a new release, without having to upload packages to all the different app stores that are out there nowadays...
You can setup an automated upload of the snap on GitHub on each release, because I think the auto update is disabled in Electron in snaps.
@mb21 snaps are read-only (but have writeable dirs in $SNAP_USER_DATA and $SNAP_USER_COMMON), so updating in place won't work. If manually publishing is a hassle, what do you think of using Travis to automatically publish into the Snap Store on release tags?
(I'm part of the Snapcraft team, for what it's worth)
Sure, I just haven't had time for this. Pull requests welcome! Or do I need to first setup Travis for this github repo? Have also heard that CircleCI might be a better choice?
Awesome! If you can enable Travis for the repo and set the SNAP_TOKEN environment variable (you'll need an account, the panwriter name registered, and snapcraft installed via brew
or snap
), I can put together a PR that adds the .travis.yml.
Sure, we could follow these instructions for Circle
Cool, yeah I've a better feeling about CircleCI, if it's not too much trouble...
I've registered the panwriter
name... and added the github project to CircleCI. Not sure yet where to find the SNAP_TOKEN
in the snapcraft GUI... will look again later...
Cool. You get the snap token via the snapcraft
command (it's in brew on Mac and apt or snap on Linux). If you snapcraft login
with the account you just created, you can:
snapcraft export-login snapcraft.login
base64 snapcraft.login
Copy that to the clipboard, then put it into a private environment variable on Circle CI (in Build > Project > Settings) called "SNAPCRAFT_LOGIN_FILE".
More detail here: https://circleci.com/docs/2.0/build-publish-snap-packages/#publishing
Okay, thanks. Do I need to do this on the same computer where I code-sign the panwriter builds? (I'm not on that computer at the moment...) Or why exactly do I need to use the commandline-program instead of the web interface?
It just has to be on a computer you're comfortable to log into your account from. If you don't want that computer to be able to manage snaps after you've exported the login token for Circle CI, you can delete the ~/.config/snapcraft directory.
I've filed a bug for being able to grab the login token from the web UI in the future: canonical/snapcraft.io#1685
I see, thanks. I've added the env variable, so all we need is the config file in the repo now I guess?
Yes, I'll work on that PR now (unless you're already on it)
Sure, that would be great!
Sorry for not getting this done yesterday. I've put together a PR in #10. It should work. I've tested the snap creation, but I cannot test the Circle CI parts.
No hurry! Thanks, I'll try it later today...
Cheers :)
Hm... not quite there yet: https://circleci.com/gh/mb21/panwriter/2
It tries to build the Windows version as well..
Fixed that... but now I'll have to add the GH_TOKEN
var.. which is again on my other machine...
I don't think we need GH_TOKEN
. It looks like electron-builder is trying to publish the assets to GitHub, but if we're just pushing to the Snap Store for now we can append --publish=never
to the npm run dist -- -l
Ah right, thanks for your help! It appears to be up in the store:
https://snapcraft.io/panwriter
Let me know how it's working!