Goreleaser to generate snaps


#1

There is a new go tool that’s becoming popular. It’s called goreleaser. It compiles the go binaries, packages them in different formats, and pushes them to github releases.

It’s very very simple to make snaps from already generated binaries, so we decided to add snap support to goreleaser.

This is the initial basic support. It works for snaps that don’t require plugs and that are not daemons. It will take the generate binary, put it in a prime directory, generate the metadata in snap.yaml and call snapcraft to compress it into a .snap.

This is a follow up from the upstream maintainer to improve the initial implementation a little (Thanks a lot
Carlos
!).

This one adds support to declare plugs and the daemon keyword:


#2

Here we added the docs:

And we found our first bug. Go projects can have a period on the name, like links.ml. So we need to allow the .goreleaser.yml to overwrite the snap name:

Here is a proposal from upstream to use a template to generate the name of the package file: