Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/buildkite-plugins/golang-cross-compile-buildkite-plugin
✨ Cross-Compile Go binaries across multiple operating system, architecture and Go versions in parallel
https://github.com/buildkite-plugins/golang-cross-compile-buildkite-plugin
buildkite buildkite-plugin golang
Last synced: 12 days ago
JSON representation
✨ Cross-Compile Go binaries across multiple operating system, architecture and Go versions in parallel
- Host: GitHub
- URL: https://github.com/buildkite-plugins/golang-cross-compile-buildkite-plugin
- Owner: buildkite-plugins
- License: mit
- Created: 2018-02-25T00:09:38.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-03-06T18:42:02.000Z (8 months ago)
- Last Synced: 2024-03-26T05:43:47.030Z (8 months ago)
- Topics: buildkite, buildkite-plugin, golang
- Language: Shell
- Homepage:
- Size: 127 KB
- Stars: 8
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Golang Cross Compile Buildkite Plugin [![Build status](https://badge.buildkite.com/ffa65d9131a0e6ea354d16a61961ec147e2e51d3447413d0dc.svg?branch=master)](https://buildkite.com/buildkite/plugins-golang-cross-compile)
A [Buildkite plugin](https://buildkite.com/docs/agent/v3/plugins) for building golang binaries against different operating systems, archictures and versions of golang.
This plugin creates a step for each build target and runs them in parallel. It's ideal for build matrixes against multiple architectures, operating systems and golang versions.
If you just need to build against a single target, use the simpler [golang plugin](https://github.com/buildkite-plugins/golang-buildkite-plugin), or if you want to avoid using docker you can use the the [gopath checkout plugin](https://github.com/buildkite-plugins/gopath-checkout-buildkite-plugin).
## Example
Build a golang binary across a set of architectures and versions.
```yml
steps:
- plugins:
- golang-cross-compile#v1.4.0:
build: main.go
import: github.com/buildkite/example
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"
```## Configuration
### `build` (optional)
The golang file to build. Can either be a relative package like `./cmd/helloworld` or a path to a file like `cli/main.go`. Defaults to `main.go`
Example: `1.10.2`
### `import`(required)
The golang package to use in the gopath in the container.
Exmaple: `github.com/buildkite/agent`
### `bin-prefix`(optional)
By default the basename of the import package is used for the binary name, use `bin-prefix` to specify a different one.
Exmaple: `buildkite-agent`
### `static`(optional)
Create a statically compiled binary, useful for alpine docker images.
### `targets` (required)
A list of targets to run in parallel. Each target can have a `version`, `goos`, `goarch` and `gomodule`.
## License
MIT (see [LICENSE](LICENSE))