From e965d4686fc78a4e09e8c816e62931ddd25da24c Mon Sep 17 00:00:00 2001 From: Shahan Khatchadourian Date: Fri, 19 Feb 2021 09:30:04 -0500 Subject: [PATCH] Show branch and commit instead of tag when not on release branch (#651) --- Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index bd9d380cc5..ace57447fb 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,15 @@ #!/usr/bin/make -f -PACKAGES_SIMTEST=$(shell go list ./... | grep '/simulation') -VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//') +BRANCH := $(shell git rev-parse --abbrev-ref HEAD) COMMIT := $(shell git log -1 --format='%H') + +# ascribe tag only if on a release/ branch, otherwise pick branch name and concatenate commit hash +VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//') +ifeq (, $(findstring release/,$(BRANCH))) + VERSION = $(BRANCH)-$(COMMIT) +endif + +PACKAGES_SIMTEST=$(shell go list ./... | grep '/simulation') LEDGER_ENABLED ?= true SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g') DOCKER := $(shell which docker)