build(mage): update Build target

This commit is contained in:
Dan Anglin 2023-08-24 13:33:17 +01:00
parent a0e3ee8a6f
commit 20d5a64d2a
Signed by: dananglin
GPG key ID: 0C1D44CFBEE68638

View file

@ -39,7 +39,11 @@ func Lint() error {
// Build build the executable. // Build build the executable.
func Build() error { 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. // Clean clean the workspace.