File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,14 @@ PROJECT_NAME := $(project)
114114endif
115115export PROJECT_NAME
116116
117+ ifeq ($(tag ) ,)
118+ TAG :=$(shell git tag --sort=committerdate | grep -E '^v[0-9]' | tail -1)
119+ # TAG :=$(shell git describe --tags `git rev-list --tags --max-count=1`)
120+ else
121+ TAG :=v$(tag )
122+ endif
123+ export TAG
124+
117125# GIT CONFIG
118126GIT_USER_NAME := $(shell git config user.name)
119127export GIT_USER_NAME
@@ -232,6 +240,13 @@ export PACKAGE_PREFIX
232240 # NOTE: 2 hashes are detected as 1st column output with color
233241 @awk ' BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?##/ {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST )
234242
243+ version :
244+ # get the most recent
245+ # @TAG=$(shell git tag --sort=committerdate | grep -E '^v[0-9]' | tail -1)
246+ # @TAG=$(shell git describe --tags `git rev-list --tags --max-count=1`)
247+ # @export TAG
248+ @echo $(TAG)
249+
235250.PHONY : help
236251help :# # print verbose help
237252 @echo ' make [COMMAND] [EXTRA_ARGUMENTS] '
@@ -306,6 +321,7 @@ report:## print environment arguments
306321 @echo ' [ARGUMENTS] '
307322 @echo ' args:'
308323 @echo ' - PROJECT_NAME=${PROJECT_NAME}'
324+ @echo ' - TAG=${TAG}'
309325 @echo ' - HOME=${HOME}'
310326 @echo ' - PWD=${PWD}'
311327 @echo ' - PYTHON=${PYTHON}'
You can’t perform that action at this time.
0 commit comments