Skip to content

Commit

Permalink
chore: modify how binary version is defined
Browse files Browse the repository at this point in the history
Signed-off-by: zemyblue <zemyblue@gmail.com>
  • Loading branch information
zemyblue committed Jun 11, 2024
1 parent f71e2e7 commit 9ed1d5b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

COMMIT ?= $(shell git log -1 --format='%H')

# ascribe tag only if on a release/ branch, otherwise pick branch name and concatenate commit hash
# Specify a tag only if it has a specific tag, otherwise choose a branch name and concatenate the commit hash.
ifeq (,$(VERSION))
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
ifeq (, $(findstring release/,$(BRANCH)))
SHORT_COMMIT := $(shell git log -1 --format='%h')
ifneq (, $(findstring $(SHORT_COMMIT),$(VERSION)))
VERSION = $(subst /,_,$(BRANCH))-$(COMMIT)
endif
endif
Expand Down

0 comments on commit 9ed1d5b

Please sign in to comment.