From 20d5a64d2a388b05efa64b67288d89b029619af6 Mon Sep 17 00:00:00 2001 From: Dan Anglin Date: Thu, 24 Aug 2023 13:33:17 +0100 Subject: [PATCH] build(mage): update Build target --- magefiles/mage.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/magefiles/mage.go b/magefiles/mage.go index 0097afd..21f22f6 100644 --- a/magefiles/mage.go +++ b/magefiles/mage.go @@ -39,7 +39,11 @@ func Lint() error { // Build build the executable. func Build() error { - return sh.Run("go", "build", "-o", binary, ".") + os.Setenv("GOOS", "linux") + os.Setenv("GOARCH", "amd64") + os.Setenv("CGO_ENABLED", "0") + + return sh.Run("go", "build", "-ldflags=-s -w", "-a", "-o", binary, ".") } // Clean clean the workspace.