diff --git a/README.md b/README.md index 509a3b9..e2255b2 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ Following inputs can be used as `step.with` keys |-----------------|---------|----------------------|----------------------------------------------------------------------------------------------------------------------------------| | `go_version` | String | `latest` | Go release to use for cross compilation from those [docker tags](https://hub.docker.com/r/crazymax/xgo/tags/). Example: `1.12.x` | | `dest` | String | `build` | Destination folder to put binaries in | +| `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. Example: `windows/amd64,linux/386` | | `v` | Bool | `false` | Prints the names of packages as they are compiled | diff --git a/action.yml b/action.yml index 34761df..3ccbd4b 100644 --- a/action.yml +++ b/action.yml @@ -13,6 +13,8 @@ inputs: dest: description: 'Destination folder to put binaries in' default: 'build' + pkg: + description: 'Sub-package to build if not root import' prefix: description: 'Prefix to use for output naming. Default to package name' targets: diff --git a/lib/xgo.js b/lib/xgo.js index c248f54..b0581c3 100644 --- a/lib/xgo.js +++ b/lib/xgo.js @@ -30,6 +30,7 @@ function run() { const xgo_version = '0.3.2'; const go_version = core.getInput('go_version'); const dest = core.getInput('dest'); + const pkg = core.getInput('pkg'); const prefix = core.getInput('prefix'); const targets = core.getInput('targets'); const v = core.getInput('v'); @@ -45,6 +46,9 @@ function run() { if (go_version) { args.push('-go', go_version); } + if (pkg) { + args.push('-pkg', pkg); + } if (prefix) { args.push('-out', prefix); } diff --git a/src/xgo.ts b/src/xgo.ts index 21b41a0..af418e0 100644 --- a/src/xgo.ts +++ b/src/xgo.ts @@ -12,6 +12,7 @@ async function run() { const xgo_version = '0.3.2'; const go_version = core.getInput('go_version'); const dest = core.getInput('dest'); + const pkg = core.getInput('pkg'); const prefix = core.getInput('prefix'); const targets = core.getInput('targets'); const v = core.getInput('v'); @@ -33,6 +34,9 @@ async function run() { if (go_version) { args.push('-go', go_version); } + if (pkg) { + args.push('-pkg', pkg); + } if (prefix) { args.push('-out', prefix); }