About
A GitHub Action for xgo, a Golang CGO cross compiler.
If you are interested, check out my other :octocat: GitHub Actions!
Usage
name: build
on:
pull_request:
push:
jobs:
xgo:
strategy:
fail-fast: false
matrix:
go_version:
- 1.12.4
- 1.13.x
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Build with xgo
uses: crazy-max/ghaction-xgo@v1
with:
xgo_version: latest
go_version: ${{ matrix.go_version }}
dest: build
prefix: myapp
targets: windows/386,windows/amd64,linux/386,linux/amd64,darwin/386,darwin/amd64
v: true
x: false
race: false
ldflags: -s -w
buildmode: default
Customizing
Following inputs can be used as step.with
keys
Name |
Type |
Description |
xgo_version |
String |
xgo version. Eg. v0.3.2 (default latest ) |
go_version |
String |
Go release to use for cross compilation from those docker tags. Eg. 1.12.x (default latest ) |
dest |
String |
Destination folder to put binaries in (default build ) |
pkg |
String |
Sub-package to build if not root import |
prefix |
String |
Prefix to use for output naming. Default to package name |
targets |
String |
Comma separated targets to build for. Eg. windows/amd64,linux/386 (default */* ) |
v |
Bool |
Prints the names of packages as they are compiled (default false ) |
x |
Bool |
Prints the build commands as compilation progresses (default false ) |
race |
Bool |
Enable data race detection (supported only on amd64) (default false ) |
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 |
Indicates which kind of object file to build (default default ) |
docker-repo |
String |
Use custom docker repo instead of official distribution (default ghcr.io/crazy-max/xgo ) |
Limitation
This action is only available for Linux virtual environments.
Keep up-to-date with GitHub Dependabot
Since Dependabot
has native GitHub Actions support,
to enable it on your GitHub repo all you need to do is add the .github/dependabot.yml
file:
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
How can I help?
All kinds of contributions are welcome ๐! The most basic way to show your support is to star ๐
the project, or to raise issues ๐ฌ 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! ๐
License
MIT. See LICENSE
for more details.