From 154cd100a6839bf3ed167dce8b9cff0831905483 Mon Sep 17 00:00:00 2001 From: Aayush Gautam Date: Mon, 26 Jun 2023 14:41:43 +0800 Subject: [PATCH] build: add version ldflag to build cmd --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 81077fa..2e6b83d 100644 --- a/Makefile +++ b/Makefile @@ -16,9 +16,9 @@ build_verify: go build -o $(GOBIN)/verify $(GOCMD)/verify/main.go release_darwin_arm64: - GOOS=darwin GOARCH=arm64 go build -o $(GOBIN)/darwin_arm64/rockx-dkg-messenger $(GOCMD)/messenger/main.go - GOOS=darwin GOARCH=arm64 go build -o $(GOBIN)/darwin_arm64/rockx-dkg-node $(GOCMD)/node/main.go $(GOCMD)/node/app_params.go - GOOS=darwin GOARCH=arm64 go build -o $(GOBIN)/darwin_arm64/rockx-dkg-cli $(GOCMD)/cli/main.go + GOOS=darwin GOARCH=arm64 go build -ldflags "-X main.version=$(VERSION) -s -w" -o $(GOBIN)/darwin_arm64/rockx-dkg-messenger $(GOCMD)/messenger/main.go + GOOS=darwin GOARCH=arm64 go build -ldflags "-X main.version=$(VERSION) -s -w" -o $(GOBIN)/darwin_arm64/rockx-dkg-node $(GOCMD)/node/main.go $(GOCMD)/node/app_params.go + GOOS=darwin GOARCH=arm64 go build -ldflags "-X main.version=$(VERSION) -s -w" -o $(GOBIN)/darwin_arm64/rockx-dkg-cli $(GOCMD)/cli/main.go mkdir -p $(GOBASE)/release/$(VERSION) @@ -29,9 +29,9 @@ release_darwin_arm64: cd $(GOBASE) release_linux_amd64: - GOOS=linux GOARCH=amd64 go build -o $(GOBIN)/linux_amd64/rockx-dkg-messenger $(GOCMD)/messenger/main.go - GOOS=linux GOARCH=amd64 go build -o $(GOBIN)/linux_amd64/rockx-dkg-node $(GOCMD)/node/main.go $(GOCMD)/node/app_params.go - GOOS=linux GOARCH=amd64 go build -o $(GOBIN)/linux_amd64/rockx-dkg-cli $(GOCMD)/cli/main.go + GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version=$(VERSION) -s -w" -o $(GOBIN)/linux_amd64/rockx-dkg-messenger $(GOCMD)/messenger/main.go + GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version=$(VERSION) -s -w" -o $(GOBIN)/linux_amd64/rockx-dkg-node $(GOCMD)/node/main.go $(GOCMD)/node/app_params.go + GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version=$(VERSION) -s -w" -o $(GOBIN)/linux_amd64/rockx-dkg-cli $(GOCMD)/cli/main.go mkdir -p $(GOBASE)/release/$(VERSION)