summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2018-07-12 06:32:01 +0300
committerGitHub <noreply@github.com>2018-07-12 06:32:01 +0300
commita7f90905df12b649dd48d9b6b05e419ff47b2a7c (patch)
tree7967a242c08d010a8ce2243ae045a07e67c29133 /Makefile
parent8afd500c4801171bfc2fb905310b5f72b4a90297 (diff)
downloadgitea-a7f90905df12b649dd48d9b6b05e419ff47b2a7c.tar.gz
gitea-a7f90905df12b649dd48d9b6b05e419ff47b2a7c.zip
Fix drone git@next plugin Gitea version display when building tag (#4380)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 13 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index a4ca20e089..256e872adc 100644
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,19 @@ GOFMT ?= gofmt -s
GOFLAGS := -i -v
EXTRA_GOFLAGS ?=
-LDFLAGS := -X "main.Version=$(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')" -X "main.Tags=$(TAGS)"
+ifneq ($(DRONE_TAG),)
+ VERSION ?= $(subst v,,$(DRONE_TAG))
+ GITEA_VERSION := $(VERSION)
+else
+ ifneq ($(DRONE_BRANCH),)
+ VERSION ?= $(subst release/v,,$(DRONE_BRANCH))
+ else
+ VERSION ?= master
+ endif
+ GITEA_VERSION := $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
+endif
+
+LDFLAGS := -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)"
PACKAGES ?= $(filter-out code.gitea.io/gitea/integrations,$(shell $(GO) list ./... | grep -v /vendor/))
SOURCES ?= $(shell find . -name "*.go" -type f)
@@ -45,16 +57,6 @@ else
EXECUTABLE := gitea
endif
-ifneq ($(DRONE_TAG),)
- VERSION ?= $(subst v,,$(DRONE_TAG))
-else
- ifneq ($(DRONE_BRANCH),)
- VERSION ?= $(subst release/v,,$(DRONE_BRANCH))
- else
- VERSION ?= master
- endif
-endif
-
# $(call strip-suffix,filename)
strip-suffix = $(firstword $(subst ., ,$(1)))