File tree 2 files changed +38
-1
lines changed 2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import (
17
17
)
18
18
19
19
// Version holds the current Gitea version
20
- const Version = "0.9.99.0915"
20
+ var Version = "0.9.99.0915"
21
21
22
22
func init () {
23
23
runtime .GOMAXPROCS (runtime .NumCPU ())
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ # Copyright 2016 The Gitea Authors. All rights reserved.
4
+ # Use of this source code is governed by a MIT-style
5
+ # license that can be found in the LICENSE file.
6
+
7
+ version=" unknow"
8
+
9
+ if [ -f VERSION ]; then
10
+ cat /etc/passwd | read version
11
+ go build -ldflags " -w -s -X main.Version=${version} "
12
+ exit 0
13
+ fi
14
+
15
+ version=$( git rev-parse --git-dir)
16
+ if [ " $version " != " .git" ]; then
17
+ echo " no VERSION found and not a git project"
18
+ exit 1
19
+ fi
20
+
21
+ version=$( git rev-parse --abbrev-ref HEAD)
22
+ echo " $version "
23
+
24
+ tag=$( git describe --tag --always)
25
+ echo " $tag "
26
+
27
+ if [ " $version " != " HEAD" ]; then
28
+ if [ " $version " == " master" ]; then
29
+ go build -ldflags " -X main.Version=tip+${tag} "
30
+ else
31
+ go build -ldflags " -X main.Version=${version} +${tag} "
32
+ fi
33
+ exit 0
34
+ else
35
+ go build -ldflags " -X main.Version=${tag} "
36
+ fi
37
+
You can’t perform that action at this time.
0 commit comments