Cross compile a Go binary
Build and cross-compile a Go binary for Linux, Windows, and Darwin architectures.
Use template →1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
steps: - label: ":golang: Cross compile" plugins: - golang-cross-compile#v1.4.0: build: main.go targets: - version: "1.11" goos: linux goarch: amd64 gomodule: "on" - version: "1.11" goos: windows goarch: amd64 gomodule: "on" - version: "1.11" goos: darwin goarch: amd64 gomodule: "on"
- Languages
- Go
- Use cases
- Continuous integration
Compile Go binary
Build and cross-compile a Go binary for Linux, Windows, and Darwin architectures.
Use template →Cross compile a Go binary
This template gives you a continuous integration (CI) pipeline that compiles a Go binary for multiple targets.
At a glance:
- For Golang projects
- Uses the Golang Cross Compile Buildkite Plugin
- Compiles for Linux, Windows, and Darwin architectures.
How it works
This template:
- Builds your Go project.
- Cross-compiles for Linux, Windows, and Darwin architectures.
Next steps
After you select Use template, you’ll:
- Connect the Git repository with your Go code.
- Configure the compute—run locally, on-premises, or in the cloud.
- Run the pipeline.
You can then play around with the pipeline settings. For example, run the pipeline locally while you iterate on the definition or set a schedule to trigger a nightly build.
If you need help, please check our documentation, raise an issue , or reach out to support.