Painless Github releases with Drone and GoReleaser

A few days ago, I’ve joined Golang community @ and I’ve found there an interesting tool GoReleaser, what a coincidence! Same day I was about to move CI/CD for one of my repository to, so a decision was made: I’m gonna switch to these tools at the same time.


If it is not obvious, I’m gonna provide you a brief summary. Manual releases are way too time consuming, boring and no one cares about those extra 10 minutes you have invested in this pointless manual procedure.

This short post will show you how to setup CI/CD pipeline which does all this stuff automatically based on git tags and SemVer versioning.

Installation of GoReleaser

You know Golang ecosystem, right? Everything there is just plug & play, download and profit. GoReleaser is not any different, download it, extract it and use it!

Simple application

Now let’s create our Golang application.

Then we can initialize GoReleaser with goreleaser initcommand, this step will create a new .goreleaser.yml with following content:

As we don’t do anything special now we’re good to go for now. Let’s try to build the first release locally.

In GOPATH/src you can get error message about disabled modules. There are two solutions for this issue. Remove hooks from .goreleaser.yaml or set GO111MODULEenvironment variable to on

This command will create a snapshot version in the dist directory. Let’s see the actual output.

As you can see — we have binaries for all major platforms. Cool. Now we can create our first SemVer release. Let’s do this!

Now we should see the correct version in the dist directory. Let’s quickly check it.

Here we go!

CI/CD integration

As I’ve said before — I’m lazy bastard. And this state does not make the whole thing any easier. I want to run these tasks automatically but in a collaborative way!

You can publish your releases directly from your computer by omitting --skip-publish flag but such process smells a bit …

As GoReleaser is just single binary — we can integrate it with in CI/CD tooling. Now I’m gonna show you basic pipeline but the release process looks the same way on other CI/CD platforms.

So this is my .drone.ymlfile:

As my dummy program does pretty much nothing I have skipped testing and linting. Make sure you have configured testing and linting pipeline in the real life scenarios!

Now we just need to enable for this project, add Github API key to the project’s secrets and push our changes to the CVS.

Push to master will immediately trigger process defined in .drone.yml file. You can check all logs in interface.

Everything is just perfect here so we can check releases page in the Github project and see if everything works as expected.

Damn yes! This is just perfect. All the future releases will be published automatically so I don’t have to think about the correct sequence of steps in the release process anymore.


It seems that GoReleaser generates some sort of automatic Changelog based on the commit history. According to SemVer, this is not 100% correct approach so you should use this automatic behaviour with some caution.

Thankfully, this behaviour can be overridden with --release-notes flag so you can publish release notes which are just silky smooth 😂

Freelance Automation / Cloud Engineer. Technology junkie and father of two children.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store