diff --git a/Makefile b/Makefile index 85ecd14..bbd67a9 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ GO=go -GOLDFLAGS=-v -s -w +VERSION=$(shell git describe --always --tags --dirty --match="v*") +GOLDFLAGS=-v -s -w -X main.version="$(VERSION)" GOBUILDFLAGS=-v -p $(shell nproc) -ldflags="$(GOLDFLAGS)" .PHONY: build test @@ -8,4 +9,4 @@ build : $(GO) build $(GOBUILDFLAGS) -o build/dnsupdater cmd/dnsupdater/main.go test : - $(GO) test -v ./... \ No newline at end of file + $(GO) test -v ./...