You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
build: Ensure clean go build environment for goreleaser and ko
Previous builds were overriding the `GOOS` and `GOARCH` enviroment
variables, which is fine to do when using `ko` directly, but appears to be
broken when building via ko using `goreleaser`.
This commit ensures that `GOOS` and `GOARCH` are always unset when
running builds by undefining them via `make` `undefine`. The `override`
keyword ensures that the env vars are always undefined regardless of the
source (e.g. enviroment, make variables, etc) to ensure a clean build
environment.
Instead of using `GOARCH` env var for building for the local build
architecure, this commit uses `goreleaser`'s `{{ .Runtime.Goarch }}`
variable available via templating which contains the architecture of the
build machine.
This commit also removes the `ldflags` config from the `ko`
configuration in `goreleaser` config as this is automatically inherited
from the `build` config referenced in the `ko` config.
0 commit comments