Fix build to correctly inject version

This commit is contained in:
James Mills 2023-03-26 13:49:09 +10:00
parent f421e30ba8
commit 2dd66671f7
No known key found for this signature in database
GPG Key ID: AC4C014F1440EBD6

View File

@ -38,16 +38,16 @@ ifeq ($(DEBUG), 1)
@echo "Building in debug mode..."
@$(GOCMD) build -tags "netgo static_build" -installsuffix netgo \
-ldflags "\
-X $(shell go list).Version=$(VERSION) \
-X $(shell go list).Commit=$(COMMIT) \
-X $(shell go list).Build=$(BUILD)" \
-X main.Version=$(VERSION) \
-X main.Commit=$(COMMIT) \
-X main.Build=$(BUILD)" \
.
else
@$(GOCMD) build -tags "netgo static_build" -installsuffix netgo \
-ldflags "-w \
-X $(shell go list).Version=$(VERSION) \
-X $(shell go list).Commit=$(COMMIT) \
-X $(shell go list).Build=$(BUILD)" \
-X main.Version=$(VERSION) \
-X main.Commit=$(COMMIT) \
-X main.Build=$(BUILD)" \
.
endif