scripts: use git describe --tags

When building a release we want to use the right tag, even if it was not
annotated.
This commit is contained in:
positiveblue 2022-11-08 13:36:50 -08:00
parent 5e95640ec6
commit a64b95cfd3
No known key found for this signature in database
GPG key ID: 4FFF2510928804DC
2 changed files with 2 additions and 2 deletions

View file

@ -17,7 +17,7 @@ GOFUZZ := go test -fuzztime 1m -fuzz
GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*" -not -name "*pb.go" -not -name "*pb.gw.go" -not -name "*.pb.json.go")
GOLIST := go list -deps $(PKG)/... | grep '$(PKG)'| grep -v '/vendor/'
COMMIT := $(shell git describe --abbrev=40 --dirty)
COMMIT := $(shell git describe --tags --dirty)
LDFLAGS := -X $(PKG).Commit=$(COMMIT)
RM := rm -f

View file

@ -30,7 +30,7 @@ function check_tag_correct() {
local tag=$1
# If a tag is specified, ensure that that tag is present and checked out.
if [[ $tag != $(git describe) ]]; then
if [[ $tag != $(git describe --tags) ]]; then
red "tag $tag not checked out"
exit 1
fi