Skip to content

Commit

Permalink
Add pkg input
Browse files Browse the repository at this point in the history
  • Loading branch information
crazy-max committed Oct 2, 2019
1 parent 0208d4e commit 8133b9f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
2 changes: 2 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions lib/xgo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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);
}
Expand Down
4 changes: 4 additions & 0 deletions src/xgo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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);
}
Expand Down

0 comments on commit 8133b9f

Please sign in to comment.