Skip to content

Conversation

joaoubaldo
Copy link
Contributor

Support ldflags when building multi binaries. This PR is a redo of #178 that also handles empty ldflags.
Because INPUT_LDFLAGS is always an argument to go build, even when empty, prefixing it with LDFLAGS_PREFIX will either use any flags or pass in an empty list of flags.
The issue with the previous PR is that the prefix was empty but the flags argument was being passed (due to double quotes):

go build -v -tags v0.1-test-assets-20241206T152818 '' -o build-artifacts-1733498920 ./test/multi-binaries/cmd1 ./test/multi-binaries/cmd2

With this PR, the above call should look like:

go build -v -tags v0.1-test-assets-20241206T152818 -ldflags '' -o build-artifacts-1733498920 ./test/multi-binaries/cmd1 ./test/multi-binaries/cmd2

@wangyoucao577
Copy link
Owner

Will it be a breaking change or not?

@joaoubaldo
Copy link
Contributor Author

Will it be a breaking change or not?

Doesn't look like it https://github.com/wangyoucao577/go-release-action/actions/runs/12238801736/job/34200195336?pr=180

@wangyoucao577 wangyoucao577 merged commit 8dbc999 into wangyoucao577:master Dec 11, 2024
1 check passed
@wangyoucao577
Copy link
Owner

Thanks very much! wangyoucao577/go-release-action@v1.53 is ready for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants