chore(CI): update version check.

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi.Wu 2022-12-24 21:26:33 +08:00
parent df6997a8e1
commit 31c298bb19

View File

@ -39,24 +39,10 @@ else
EXECUTABLE ?= $(EXECUTABLE)
endif
STORED_VERSION_FILE := VERSION
ifneq ($(DRONE_TAG),)
VERSION ?= $(subst v,,$(DRONE_TAG))
RELASE_VERSION ?= $(VERSION)
VERSION ?= $(DRONE_TAG)
else
ifneq ($(DRONE_BRANCH),)
VERSION ?= $(subst release/v,,$(DRONE_BRANCH))
else
VERSION ?= master
endif
STORED_VERSION=$(shell cat $(STORED_VERSION_FILE) 2>/dev/null)
ifneq ($(STORED_VERSION),)
RELASE_VERSION ?= $(STORED_VERSION)
else
RELASE_VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
endif
VERSION ?= $(shell git describe --tags --always || git rev-parse --short HEAD)
endif
TAGS ?=