Goreleaser to generate snaps

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.

https://github.com/goreleaser/goreleaser/pull/317

This is a follow up from the upstream maintainer to improve the initial implementation a little (Thanks a lot
Carlos
!).
https://github.com/goreleaser/goreleaser/pull/321

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

https://github.com/goreleaser/goreleaser/pull/325

2 Likes

Here we added the docs:

https://github.com/goreleaser/goreleaser/pull/327

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:

https://github.com/goreleaser/goreleaser/pull/328

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

https://github.com/goreleaser/goreleaser/pull/329