为Github构建Golang发布二进制文件

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?

Thanks for all the suggestions and answers that were given. Cross-compilation 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 a focus on cross-compiling, packaging and deployment". It was inspired by Dave Cheney's work, and also includes deploy tools for Github - just what I was looking for. (For example, I used it to release soniah/awsenv)

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.

I created goreleaser to do just that.

You can try it out if you want :)