lfreleng-actions/🛠️ Go Build
Builds Go projects with optional cross-compilation
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Activelast commit Jul 9, 2026
- License
- None
Pinned Snippet
uses: lfreleng-actions/go-build-action@3d4c7aef5040660688b5c35aaef0f0a91e11cb94 # v0.0.1tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| go_version | Explicit Go version to install; takes precedence over go_version_file | no | "" |
| go_version_file | File to read the Go version from, relative to path_prefix; must resolve within it | no | go.mod |
| path_prefix | Project directory; must resolve within the workspace | no | . |
| build_flags | Extra go build flags; allowed characters: A-Z a-z 0-9 space . _ / = , : @ + - | no | "" |
| goos | Target operating system (GOOS); requires goarch; empty builds for the runner platform | no | "" |
| goarch | Target architecture (GOARCH); requires goos; empty builds for the runner platform | no | "" |
| cgo_enabled | CGO_ENABLED value for the build: '0' or '1' | no | 0 |
| ldflags | Linker flags passed via -ldflags; allowed characters: A-Z a-z 0-9 space . _ / = , : @ + - | no | "" |
| output_name | Binary filename to build; requires a build_target naming one main package; allowed characters: A-Z a-z 0-9 . _ - | no | "" |
| build_target | Space-separated package pattern(s) to build; tokens must not start with '-'; allowed characters: A-Z a-z 0-9 space . _ / - | no | ./... |
| artifact_upload | Upload the built binary as an artifact; requires output_name | no | false |
| artifact_name | Artifact name; allowed characters: A-Z a-z 0-9 . _ - | no | go-binary |
Outputs
| name | description |
|---|---|
| binary_path | Absolute path to the built binary (when output_name set) |
| go_version_used | Go toolchain version the build used |