From 31c298bb194b721825019e1a8a44cfcadcc3e270 Mon Sep 17 00:00:00 2001 From: "Bo-Yi.Wu" Date: Sat, 24 Dec 2022 21:26:33 +0800 Subject: [PATCH] chore(CI): update version check. Signed-off-by: Bo-Yi.Wu --- Makefile | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 373297e..5dc279e 100644 --- a/Makefile +++ b/Makefile @@ -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 ?=