Skip to content

Goreleaser: mini tutorial

Neil O'Toole edited this page Mar 18, 2020 · 2 revisions

This page explains how to add various goreleaser publishing steps to a bare-bones project.

Adding brew

For background, see the brew docs. In this case, we want to be able to install neilotoole/sqlitr via brew.

First, create a new repository neilotoole/homebrew-sqlitr.

Then, add the following to .goreleaser.yml:

brews:
  -
    homepage: "https://github.com/neilotoole/sqlitr"
    description: "sqlitr is a trivial Go/CGo SQLite CLI"
    github:
      owner: neilotoole
      name: homebrew-sqlitr

Push changes to git, and tag (e.g. git tag v0.1.2 && git push origin v0.1.2). Then execute ./goreleaser-release.sh. This will build everything, push a release to GitHub, and push a formula sqlitr.rb to neilotoole/homebrew-sqlitr.

Then (on macOS):

$ brew tap neilotoole/sqlitr && brew install sqlitr
$ which sqlitr    # verify you're not accidentally using the $GOPATH/bin sqlitr
/usr/local/bin/sqlitr
$ sqlitr --version
sqlitr 0.1.2  2020-03-11T11:22:48Z  7114890b5f7532143286362f6426063743fa502c

Adding scoop

Add the following to .goreleaser.yml:

scoop:
  bucket:
    owner: neilotoole
    name: sqlitr
  homepage: "https://github.com/neilotoole/sqlitr"
  description: "sqlitr is a trivial Go/CGo SQLite CLI"

As above with brew, push to git, tag, and ./goreleaser-release.sh. This will add sqlitr.json to neilotole/sqlitr.

Then (on Windows):

$ scoop bucket add sqlitr https://github.com/neilotoole/sqlitr
$ scoop install sqlitr

Adding snap

See the wiki page for snapcraft.

Clone this wiki locally