UX: version configuration (#5740)

## Description

- when not on a tag `tendermint version` will return "unreleased-`branchName`-`commitHash`"

Closes: #XXX
This commit is contained in:
Marko
2020-12-03 15:18:08 +00:00
committed by GitHub
parent 9205e85a9b
commit 8a80b97865
2 changed files with 13 additions and 4 deletions
+8 -1
View File
@@ -4,7 +4,14 @@ PACKAGES=$(shell go list ./...)
BUILDDIR ?= $(CURDIR)/build
BUILD_TAGS?=tendermint
VERSION := $(shell git describe --always)
# If building a release, please checkout the version tag to get the correct version setting
ifneq ($(shell git branch --show-current),)
VERSION := unreleased-$(shell git branch --show-current)-$(shell git rev-parse HEAD)
else
VERSION := $(shell git describe)
endif
LD_FLAGS = -X github.com/tendermint/tendermint/version.TMCoreSemVer=$(VERSION)
BUILD_FLAGS = -mod=readonly -ldflags "$(LD_FLAGS)"
HTTPS_GIT := https://github.com/tendermint/tendermint.git