Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable cgo by default #31

Merged
merged 4 commits into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ When the `release` workflow finishes running, compiled binaries will be uploaded

You can safely test out release automation by creating tags that have a `-` in them; for example: `v2.0.0-rc.1`. Such Releases will be published as _prereleases_ and will not count as a stable release of your extension.

By default, the action runs with cgo disabled. To override that default, set the `cgo_enabled` parameter to `1`:

```yaml
- uses: cli/gh-extension-precompile@v1
with:
cgo_enabled: 1
bewuethr marked this conversation as resolved.
Show resolved Hide resolved
```

## Extensions written in other compiled languages

If you aren't using Go for your compiled extension, you'll need to provide your own script for compiling your extension:
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ inputs:
go_version:
description: "The Go version to use for compiling (supports semver spec and ranges)"
default: "1.18"
cgo_enabled:
description: "The value of the CGO_ENABLED environment variable"
default: 0
branding:
color: purple
icon: box
Expand All @@ -24,4 +27,5 @@ runs:
GITHUB_TOKEN: ${{ github.token }}
GH_EXT_BUILD_SCRIPT: ${{ inputs.build_script_override }}
GPG_FINGERPRINT: ${{ inputs.gpg_fingerprint }}
CGO_ENABLED: ${{ inputs.cgo_enabled }}
shell: bash