From 410af6971b87ac5dc7ac198f538d8383c1f47a1f Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Thu, 6 Apr 2017 17:32:28 +0200 Subject: [PATCH] Set VERSION from git once, in a variable (#1447) --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3614364df..25007a976 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,9 @@ JAVASCRIPTS := GOFLAGS := -i -v EXTRA_GOFLAGS ?= -LDFLAGS := -X "main.Version=$(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')" -X "main.Tags=$(TAGS)" +VERSION := $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//') + +LDFLAGS := -X "main.Version=$(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)