I'm looking for ideas on how to easily build binaries for common platforms for a Golang project, for release on Github.
I already know how to manually do releases, using Github's instructions at Creating Releases. And I'm currently doing releases using aktau/github-release, but this requires manually logging into different machines (OSX, Linux, Windows) and doing the release.
Benedikt Lang has blogged about using Travis-CI (which I'm yet to experiment with). But I presume the public Travis will only build binaries for Linux.
Any suggestions?
You are most likely right about the Travis CI only building in Linux as go cross-compilation requires you to build from source and build other go executables. Like RoninDev suggested, I would suggest that you setup 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 easy, and only takes about 10 minutes. After you have that, a build tool such as Jenkins will give you the controls to kick off a build for the desired platforms (Mac, Windows, Linux, etc) and then push out git releases for each one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With