File tree 4 files changed +12
-1
lines changed
4 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 4
4
builds :
5
5
- env :
6
6
- CGO_ENABLED=0
7
+ ldflags :
8
+ - -X main.version={{ .Version }}
7
9
goos :
8
10
- darwin
9
11
- linux
@@ -31,6 +33,8 @@ changelog:
31
33
filters :
32
34
exclude :
33
35
- typo
36
+ - " ^test:"
34
37
release :
35
38
prerelease : auto
36
39
mode : append
40
+ draft : false
Original file line number Diff line number Diff line change 1
1
PREFIX ?= /usr/local
2
- VERSION ?= $(shell git describe --tags --dirty --always | sed -e 's/^v//' )
2
+ VERSION ?= $(shell git describe --tags --abbrev=0 )
3
3
4
4
.PHONY : go-install
5
5
go-install :
Original file line number Diff line number Diff line change
1
+ v0.0.4
Original file line number Diff line number Diff line change 1
1
package main
2
2
3
3
import (
4
+ _ "embed"
4
5
"flag"
5
6
"fmt"
6
7
"os"
@@ -10,6 +11,9 @@ import (
10
11
"github.com/zaidfadhil/kemit/git"
11
12
)
12
13
14
+ //go:embed VERSION
15
+ var version string
16
+
13
17
func main () {
14
18
cfg := & config.Config {}
15
19
err := cfg .Load () //nolint:errcheck
@@ -23,6 +27,8 @@ func main() {
23
27
if err != nil {
24
28
end (err )
25
29
}
30
+ } else if os .Args [1 ] == "version" {
31
+ fmt .Printf ("kemit version: %s" , version )
26
32
}
27
33
} else {
28
34
err = cfg .Validate ()
You can’t perform that action at this time.
0 commit comments