How to set -ldflags
values for each target in Goreleaser?
#1709
-
I need to set the Os/Arch variable for each build target. My initial thought was to have a script that would calculate these variables and using hooks to run this script every target.
But as the variables are not defined anywhere in the config, so it seems it fails to recognize them, throwing:
Which makes sense. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
the problem with this is that the hook will not export the envs to the build it self... if you want to do that, you should probably run like |
Beta Was this translation helpful? Give feedback.
-
@caarlos0 Hi! is it possible to set ldflags for each target without bash script?
|
Beta Was this translation helpful? Give feedback.
the problem with this is that the hook will not export the envs to the build it self...
if you want to do that, you should probably run like
./variables.sh && goreleaser --etc