summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2016-12-13 05:48:58 +0100
committerLunny Xiao <xiaolunwen@gmail.com>2016-12-13 12:48:58 +0800
commit1d1c01875dc4f07b204a40aa662aa1782bf000fd (patch)
treecdeed3ba917dfd68951e93d60e4738e08f419316 /Makefile
parentf0a989c1d0843ab47a48be5219470a93a462e302 (diff)
downloadgitea-1d1c01875dc4f07b204a40aa662aa1782bf000fd.tar.gz
gitea-1d1c01875dc4f07b204a40aa662aa1782bf000fd.zip
Autogenerate Version on build (#190)
* Autogenerate Version On Build * Fixes * Changed Version to v0.9.0 * balls * I hate newlines * Don't remove .VERSION-file on `make clean` * v0.9.0 => 1.0.0 * damn new-lines... * Always rebuild templates/.VERSION * Delete .VERSION * Update Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 3 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 75aef7f3cf..ae049d0086 100644
--- a/Makefile
+++ b/Makefile
@@ -9,8 +9,9 @@ BINDATA := $(shell find conf | sed 's/ /\\ /g')
STYLESHEETS := $(wildcard public/less/index.less public/less/_*.less)
JAVASCRIPTS :=
-LDFLAGS += -X "code.gitea.io/gitea/modules/setting.BuildTime=$(DATE)"
-LDFLAGS += -X "code.gitea.io/gitea/modules/setting.BuildGitHash=$(SHA)"
+VERSION = $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
+
+LDFLAGS += -X "main.Version=$(VERSION)"
TARGETS ?= linux/*,darwin/*,windows/*
PACKAGES ?= $(shell go list ./... | grep -v /vendor/)