dayDreams ++

Go ❤️ Travis+Gorelaser

January 05, 2020

Past Month, I’ve been wworking on Shelby a lot. I had set up my CI pipeline using Travis CI by a .travis.yml file from Powerline Go.I used a shell script from Mimir’s documentaion to help users install the binary or tar.
I had tweaked both of em a bit to make it work for Shelby’s requirements.

The Email

One day morning, I e-mailed @talal since I used some of the source code from Mimir for bootstrapping the project. He was so happy to receive the Email and gave mesome much needed feedback for Shelby. Out of this was one to try out Goreleaser for deployment. So I went on try it. Some other feedback also came from one of my telegram group TinkerHub to change the default installation path.

We’ll be using goreleaser to Deploy a Go application to GitHub Releases.I am writing this because the Docs were a bit confusing to me.

Setting Up Goreleaser and Travis CI

All the installation Instructions of Gorelaser can be found in their Official Docs.
After Installing Goreleaser, you just have to cd to that go repository you want to deploy and run goreleaser init. This command will create a goreleaser.yml already filled with some commands and stuff.

Here is the Gorelaser part to Deploy the Application to GitHUb Relases

    owner: <username>
    name: <repo>

You can add this to the bottom of the .gorealeaser.yml file and it’ll work fine.

For Deploying to GitHub Releases Add this to your .travis.yml file

- provider: script
  skip_cleanup: true
  script: curl -sL | bash
    tags: true

This will only deploy to GitHub releases when a tag is created and pushed. You will need a GitHub Token in the Repo scope and while adding it to Travis Secrets you must name it like GITHUB_TOKEN only.

Some tips before pushing a tags for checking Goreleaser.

You can always try goreleaser in you the terminal.

  • Try goreleaser release --skip-publish command and you can always test with this before you push to GitHub. I’d totally suggest this since I had simply pushed without any testing and I had to write the whole thing…again.


You can install godownloader from their releases page. Follow the next steps to use it Globally

$ tar -xvf <filename>.tar.gz
$ mv godownloader /usr/local/bin/

Now go to your working folder and run

$ godownloader --repo=<user>/<repo> >

This will make a file which can be used as an installation script.

Here are my Pipelines

  • .travis.yml
sudo: false
language: go

  - "1.13"
  - go get -v
  - go build
  - rm -rf shelby
# before we deploy, we go build for all operating systems we would like to support
- provider: script
  skip_cleanup: true
  script: curl -sL | bash
    tags: true
  • .goreleaser.yml

    # you may remove this if you don't use vgo
    - go mod tidy
    # you may remove this if you don't need go generate
    - go get -v 

    - -s -w 
    - darwin
    - linux
    - amd64
- replacements:
    darwin: Darwin
    linux: Linux
    amd64: x86_64
  name_template: 'checksums.txt'
  name_template: "{{ .Tag }}"
  sort: asc
    - '^docs:'
    - '^test:'
    owner: athul
    name: shelby

Personal Blog of Athul Cyriac Ajay who is an Undergraduate Engineering Student in College of Engineering Kidangoor, a GitHub Campus Expert and a Python, Go lover.
Find me on                Subscribe to the Newsletter