Create Golang for Two for Github

I'm looking for ideas on how to easily create binaries for common platforms for a Golang project, for release on Github.

I already know how to manually make releases using the Github instructions in Creating releases . And now I am doing releases using aktau / github-release , but this requires manual logging on different computers (OSX, Linux, Windows) and release.

Benedict Lang blogged on using Travis-CI (which I am still experimenting with). But I guess the Travis community will be creating binaries for Linux.

Any suggestions?

+6
source share
3 answers

Thanks for all the suggestions and answers that have been given. Cross compiling was what I was looking for, and Dave Cheney's blog post was a good start.

However, I found a better solution - laher / goxc - "a build tool for Go with an emphasis on cross-compilation, packaging, and deployment." He was inspired by the work of Dave Cheney and also includes deployment tools for Github - exactly what I was looking for. (For example, I used it to release soniah / awsenv )

+4
source

You are most likely right that only Travis CI only works on Linux, since cross-compiling requires you to build from the source code and build other go executables. As suggested by RoninDev, I suggest you set up your own cross-compilation build environment by following the blog post:

http://dave.cheney.net/2012/09/08/an-introduction-to-cross-compilation-with-go

It is quite simple and takes about 10 minutes. After that, a build tool like Jenkins will give you the controls to start building for your desired platforms (Mac, Windows, Linux, etc.), and then release git for each one.

+4
source

I created a goreleaser to do just that.

You can try if you want :)

+1
source

All Articles