fix: Fix linux build with CGO_ENABLED=0#311
Conversation
| - amd64 | ||
| - arm64 | ||
| env: | ||
| - CGO_ENABLED=0 |
There was a problem hiding this comment.
Running the binary in a linux environment would fail if it's built with CGO.
| with: | ||
| version: latest | ||
| args: release ${{ inputs.dry-run == 'true' && '--skip=publish' || '' }} | ||
| args: release ${{ inputs.dry-run-gh == true && '--skip=publish' || '' }} --config .goreleaser.yaml |
There was a problem hiding this comment.
Added a more granular variable that decides to run the action or not and specifies the config file that says how to build the binary.
There was a problem hiding this comment.
There's no dry-run-gh input defined in this (publish) action
There was a problem hiding this comment.
So, as far as I know github actions inputs are strings. This change (removing the '..') means you're casting the value to a bool and it'll always evaluate to true (probably?) if any string is present.
I'd recommend leaving it as an explicit comparison to the value 'true'.
Yea, it's really frustrating.
| workflow_dispatch: | ||
| inputs: | ||
| dry-run: | ||
| default: true |
There was a problem hiding this comment.
Sorted these values.
| description: 'Skip publishing to DockerHub and Homebrew' | ||
| required: false | ||
| type: boolean | ||
| dry-run-gh: |
There was a problem hiding this comment.
Added more granular variables for manual publishing.
|
I ran the manual publish workflow and got feedback that the generated linux binary works now. |
| with: | ||
| version: latest | ||
| args: release ${{ inputs.dry-run == 'true' && '--skip=publish' || '' }} | ||
| args: release ${{ inputs.dry-run-gh == true && '--skip=publish' || '' }} --config .goreleaser.yaml |
There was a problem hiding this comment.
There's no dry-run-gh input defined in this (publish) action
| with: | ||
| version: latest | ||
| args: release ${{ inputs.dry-run == 'true' && '--skip=publish' || '' }} | ||
| args: release ${{ inputs.dry-run-gh == true && '--skip=publish' || '' }} --config .goreleaser.yaml |
There was a problem hiding this comment.
So, as far as I know github actions inputs are strings. This change (removing the '..') means you're casting the value to a bool and it'll always evaluate to true (probably?) if any string is present.
I'd recommend leaving it as an explicit comparison to the value 'true'.
Yea, it's really frustrating.
Runs the goreleaser action with the goreleaser.yaml file that has a new builds section.
Requirements
Related issues
Provide links to any issues in this repository or elsewhere relating to this pull request.
Describe the solution you've provided
Provide a clear and concise description of what you expect to happen.
Describe alternatives you've considered
Provide a clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context about the pull request here.