From bc5cfbd442475dc57aa4468ebde117e7da7adaf0 Mon Sep 17 00:00:00 2001 From: Theo Chatzimichos Date: Mon, 10 Jun 2024 22:46:51 +0200 Subject: [PATCH] fix(Earthfile): Add .exe extension in the windows binaries This is a regression compared to the Makefile era, see for example https://releases.crossplane.io/stable/v1.16.0/bin/windows_amd64/ and also what install.sh expects. Signed-off-by: Theo Chatzimichos --- Earthfile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Earthfile b/Earthfile index 4fa7bf6e97e..6ca83ac2b8e 100644 --- a/Earthfile +++ b/Earthfile @@ -154,12 +154,16 @@ go-build: ARG GOFLAGS="-ldflags=-X=github.com/crossplane/crossplane/internal/version.version=${CROSSPLANE_VERSION}" ARG CGO_ENABLED=0 FROM +go-modules + LET ext = "" + IF [ "$GOOS" = "windows" ] + SET ext = ".exe" + END CACHE --id go-build --sharing shared /root/.cache/go-build COPY --dir apis/ cmd/ internal/ pkg/ . - RUN go build -o crossplane ./cmd/crossplane - RUN go build -o crank ./cmd/crank - SAVE ARTIFACT crossplane AS LOCAL _output/bin/${GOOS}_${GOARCH}/crossplane - SAVE ARTIFACT crank AS LOCAL _output/bin/${GOOS}_${GOARCH}/crank + RUN go build -o crossplane${ext} ./cmd/crossplane + RUN go build -o crank${ext} ./cmd/crank + SAVE ARTIFACT crossplane${ext} AS LOCAL _output/bin/${GOOS}_${GOARCH}/crossplane${ext} + SAVE ARTIFACT crank${ext} AS LOCAL _output/bin/${GOOS}_${GOARCH}/crank${ext} # go-multiplatform-build builds Crossplane binaries for all supported OS # and architectures.