Enable detect version by git tags (#63)
This commit is contained in:
parent
e7d751bbc8
commit
e9d590264b
|
@ -39,6 +39,10 @@ jobs:
|
|||
steps:
|
||||
- name: checkout code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
# Number of commits to fetch. 0 indicates all history for all branches and tags.
|
||||
# We need to guess version via git tags.
|
||||
fetch-depth: 0
|
||||
- name: install Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
|
|
19
Makefile
19
Makefile
|
@ -12,11 +12,20 @@ REGISTRY_USER_NAME?=""
|
|||
REGISTRY_PASSWORD?=""
|
||||
REGISTRY_SERVER_ADDRESS?=""
|
||||
|
||||
# Set you version by env or using latest tags from git
|
||||
VERSION?=$(shell git describe --tags)
|
||||
|
||||
# We don't have tags yet, so just use hardcode one
|
||||
VERSION="latest"
|
||||
# Set your version by env or using latest tags from git
|
||||
VERSION?=""
|
||||
ifeq ($(VERSION), "")
|
||||
$(info "Guessing version from git latest tags...")
|
||||
LATEST_TAG=$(shell git describe --tags)
|
||||
ifeq ($(LATEST_TAG),)
|
||||
# Forked repo may not sync tags from upstream, so give it a default tag to make CI happy.
|
||||
$(info "no tags found, set version with unknown")
|
||||
VERSION="unknown"
|
||||
else
|
||||
$(info "using latest git tag($(LATEST_TAG)) as version")
|
||||
VERSION=$(LATEST_TAG)
|
||||
endif
|
||||
endif
|
||||
|
||||
all: karmada-controller-manager karmadactl
|
||||
|
||||
|
|
Loading…
Reference in New Issue