mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-11-10 10:05:18 +00:00
Fix kava version build tag for detached HEAD state (#1465)
* use tag for kava version if we are in a detached HEAD state; add print-git-info target for displaying git data * refactor to ignore any detached head state; rely on checkout of exact tag
This commit is contained in:
parent
f9b353753c
commit
9d059f5ed9
13
Makefile
13
Makefile
@ -9,9 +9,16 @@ GIT_COMMIT_SHORT := $(shell git rev-parse --short HEAD)
|
|||||||
|
|
||||||
BRANCH_PREFIX := $(shell echo $(GIT_BRANCH) | sed 's/\/.*//g')# eg release, master, feat
|
BRANCH_PREFIX := $(shell echo $(GIT_BRANCH) | sed 's/\/.*//g')# eg release, master, feat
|
||||||
|
|
||||||
|
EXACT_TAG := $(shell git describe --tags --exact-match 2> /dev/null)
|
||||||
|
RECENT_TAG := $(shell git describe --tags)
|
||||||
|
|
||||||
ifeq ($(BRANCH_PREFIX), release)
|
ifeq ($(BRANCH_PREFIX), release)
|
||||||
# we are on a release branch, set version to the last or current tag
|
# we are on a release branch, set version to the last or current tag
|
||||||
VERSION := $(shell git describe --tags)# use current tag or most recent tag + number of commits + g + abbrivated commit
|
VERSION := $(RECENT_TAG)# use current tag or most recent tag + number of commits + g + abbrivated commit
|
||||||
|
VERSION_NUMBER := $(shell echo $(VERSION) | sed 's/^v//')# drop the "v" prefix for versions
|
||||||
|
else ifeq ($(EXACT_TAG), $(RECENT_TAG))
|
||||||
|
# we have a tag checked out directly
|
||||||
|
VERSION := $(RECENT_TAG)# use exact tag
|
||||||
VERSION_NUMBER := $(shell echo $(VERSION) | sed 's/^v//')# drop the "v" prefix for versions
|
VERSION_NUMBER := $(shell echo $(VERSION) | sed 's/^v//')# drop the "v" prefix for versions
|
||||||
else
|
else
|
||||||
# we are not on a release branch, and do not have clean tag history (etc v0.19.0-xx-gxx will not make sense to use)
|
# we are not on a release branch, and do not have clean tag history (etc v0.19.0-xx-gxx will not make sense to use)
|
||||||
@ -22,6 +29,10 @@ endif
|
|||||||
TENDERMINT_VERSION := $(shell go list -m github.com/tendermint/tendermint | sed 's:.* ::')
|
TENDERMINT_VERSION := $(shell go list -m github.com/tendermint/tendermint | sed 's:.* ::')
|
||||||
COSMOS_SDK_VERSION := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's:.* ::')
|
COSMOS_SDK_VERSION := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's:.* ::')
|
||||||
|
|
||||||
|
.PHONY: print-git-info
|
||||||
|
print-git-info:
|
||||||
|
@echo "branch $(GIT_BRANCH)\nbranch_prefix $(BRANCH_PREFIX)\ncommit $(GIT_COMMIT)\ncommit_short $(GIT_COMMIT_SHORT)"
|
||||||
|
|
||||||
.PHONY: print-version
|
.PHONY: print-version
|
||||||
print-version:
|
print-version:
|
||||||
@echo "kava $(VERSION)\ntendermint $(TENDERMINT_VERSION)\ncosmos $(COSMOS_SDK_VERSION)"
|
@echo "kava $(VERSION)\ntendermint $(TENDERMINT_VERSION)\ncosmos $(COSMOS_SDK_VERSION)"
|
||||||
|
Loading…
Reference in New Issue
Block a user