You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Golang CGO cross compiler
v3.0.0
A GitHub Action for xgo, a Golang CGO cross-compiler.
name: build
on:
push:
pull_request:
jobs:
xgo:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Build
uses: crazy-max/ghaction-xgo@v2
with:
xgo_version: latest
go_version: 1.18
dest: build
prefix: myapp
targets: windows/amd64,linux/amd64,linux/arm64,darwin/arm64
v: true
x: false
race: false
ldflags: -s -w
buildmode: default
trimpath: true
Following inputs can be used as step.with
keys
Name | Type | Default | Description |
---|---|---|---|
xgo_version |
String | latest |
xgo version (e.g., v0.24.0 ) |
go_version |
String | latest |
Go release to use for cross compilation from those docker tags (e.g., 1.19 ) |
dest |
String | build |
Destination folder to put binaries in |
pkg |
String | Sub-package to build if not root import | |
prefix |
String | package name | Prefix to use for output naming |
targets |
String | */* |
Comma separated targets to build for (e.g. windows/amd64,linux/386 ) |
v |
Bool | false |
Prints the names of packages as they are compiled |
x |
Bool | false |
Prints the build commands as compilation progresses |
race |
Bool | false |
Enable data race detection |
tags |
String | Comma separated list of build tags to consider satisfied during the build | |
ldflags |
String | Arguments to pass on each go tool link invocation | |
buildmode |
String | default |
Indicates which kind of object file to build |
buildvcs |
String | Whether to stamp binaries with version control information | |
trimpath |
Bool | false |
Remove all file system paths from the resulting executable |
working_dir |
String | $GITHUB_WORKSPACE |
Working directory |
This action is only available for Linux virtual environments.
Want to contribute? Awesome! The most basic way to show your support is to star the project, or to raise issues. If you want to open a pull request, please read the contributing guidelines.
You can also support this project by becoming a sponsor on GitHub or by making a Paypal donation to ensure this journey continues indefinitely!
Thanks again for your support, it is much appreciated! 🙏
MIT. See LICENSE
for more details.