diff --git a/Makefile b/Makefile index 0ecc5622..18d39f20 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,17 @@ .PHONY: all install build release capdefs test smoke gofmt irctest GIT_COMMIT := $(shell git rev-parse HEAD 2> /dev/null) +GIT_TAG := $(shell git tag --points-at HEAD 2> /dev/null | head -n 1) capdef_file = ./irc/caps/defs.go all: install install: - go install -v -ldflags "-X main.commit=$(GIT_COMMIT)" + go install -v -ldflags "-X main.commit=$(GIT_COMMIT) -X main.version=$(GIT_TAG)" build: - go build -v -ldflags "-X main.commit=$(GIT_COMMIT)" + go build -v -ldflags "-X main.commit=$(GIT_COMMIT) -X main.version=$(GIT_TAG)" release: goreleaser --skip-publish --rm-dist