From d3da40e0ad20a8646c7b461addc20a3377a05c9c Mon Sep 17 00:00:00 2001 From: Allisson Azevedo Date: Sat, 10 Oct 2020 12:05:32 -0300 Subject: [PATCH] feat(release): strip binary to reduce size --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 968e716..8bd9cbd 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -TARGETS = darwin/amd64 darwin/386 linux/amd64 linux/386 windows/amd64 windows/386 +TARGETS = darwin/amd64 linux/amd64 linux/386 windows/amd64 windows/386 GIT_COMMIT = $(shell git rev-parse HEAD) BUILD_TIME = $(shell date -u +"%Y-%m-%dT%H:%M:%SZ" | tr -d '\n') GO_VERSION = $(shell go version | awk {'print $$3'}) @@ -50,12 +50,12 @@ release: clean assets @echo "Building binaries..." @gox \ -osarch "$(TARGETS)" \ - -ldflags "-X github.com/sosedoff/pgweb/pkg/command.GitCommit=$(GIT_COMMIT) -X github.com/sosedoff/pgweb/pkg/command.BuildTime=$(BUILD_TIME) -X github.com/sosedoff/pgweb/pkg/command.GoVersion=$(GO_VERSION)" \ + -ldflags "-s -w -X github.com/sosedoff/pgweb/pkg/command.GitCommit=$(GIT_COMMIT) -X github.com/sosedoff/pgweb/pkg/command.BuildTime=$(BUILD_TIME) -X github.com/sosedoff/pgweb/pkg/command.GoVersion=$(GO_VERSION)" \ -output "./bin/pgweb_{{.OS}}_{{.Arch}}" @echo "Building ARM binaries..." GOOS=linux GOARCH=arm GOARM=5 go build \ - -ldflags "-X github.com/sosedoff/pgweb/pkg/command.GitCommit=$(GIT_COMMIT) -X github.com/sosedoff/pgweb/pkg/command.BuildTime=$(BUILD_TIME) -X github.com/sosedoff/pgweb/pkg/command.GoVersion=$(GO_VERSION)" \ + -ldflags "-s -w -X github.com/sosedoff/pgweb/pkg/command.GitCommit=$(GIT_COMMIT) -X github.com/sosedoff/pgweb/pkg/command.BuildTime=$(BUILD_TIME) -X github.com/sosedoff/pgweb/pkg/command.GoVersion=$(GO_VERSION)" \ -o "./bin/pgweb_linux_arm_v5" @echo "\nPackaging binaries...\n"