File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22mts.yaml
33vendor /
44backups /
5+ dist /
Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ project_name: react
33source :
44 enabled : false
55
6- env :
7- - GO111MODULE=on
6+ # env:
7+ # - GO111MODULE=on
88 # - GOPROXY=https://gocenter.io
99
1010before :
@@ -32,7 +32,10 @@ builds:
3232 - GOTELEMETRY="off"
3333 flags :
3434 - -v
35- ldflags : -X github.com/mbevc1/react/main.Version={{.Env.VERSION}}
35+ # ldflags: -X github.com/mbevc1/react/main.Version={{.Env.VERSION}}
36+
37+ upx :
38+ - enabled : true
3639
3740archives :
3841 - id : react
@@ -62,7 +65,6 @@ release:
6265 draft : false
6366 disable : false
6467
65-
6668checksum :
6769 # name_template: "{{ .ProjectName }}_{{ .Version }}_sha256_checksums.txt"
6870 name_template : " {{ .ProjectName }}_{{ .Version }}_sha256_checksums.txt"
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ RED=\033[31;01m
1212VER? =dev
1313GHASH: =$(shell git rev-parse --short HEAD)
1414VERSION? =$(shell git describe --tags --always --dirty --match=v* 2> /dev/null || echo v0)
15+ GOTELEMETRY: = off
1516GO: = go
1617GO_BUILD: = go build -mod vendor -ldflags "-s -w -X main.GitCommit=${GHASH} -X main.Version=${VERSION}"
1718# VERSION="${VERSION}" goreleaser --snapshot --rm-dist
@@ -30,7 +31,7 @@ vendor: **/*.go ## Build vendor deps
3031 GO111MODULE=on $(GO_VENDOR )
3132
3233clean : clean-vendor # # Clean artefacts
33- rm -rf $(BIN ) $(BIN ) _* $(BIN ) .exe go.sum
34+ rm -rf $(BIN ) $(BIN ) _* $(BIN ) .exe dist/
3435
3536clean-vendor : # # Clean vendor folder
3637 rm -rf vendor
@@ -41,6 +42,9 @@ build: clean $(BIN) ## Build binary
4142run :
4243 go run .
4344
45+ snapshot : clean # # Build local snapshot
46+ goreleaser build --snapshot --clean
47+
4448dev : clean # # Dev test target
4549 go build -ldflags " -s -w -X main.Version=${VER} " -o $(BIN )
4650 upx $(BIN )
Original file line number Diff line number Diff line change @@ -31,13 +31,20 @@ func main() {
3131 flag .Parse ()
3232
3333 if * ver {
34- fmt .Printf ("%s %v\n " , Name , Version )
35- if GitCommit != "" {
36- fmt .Printf ("Commit hash : %v \n " , GitCommit )
34+ fmt .Printf ("%s version %v\n " , Name , version )
35+ if commit != "" {
36+ fmt .Printf ("commit : %s \n " , commit )
3737 }
38+ fmt .Printf ("built at: %s\n " , date )
39+ fmt .Printf ("built by: %s\n " , builtBy )
3840 os .Exit (0 )
3941 } else if * cmd == "" && ! * bck && ! * rbt && ! * upg || * hlp {
40- fmt .Printf ("%s %v\n " , Name , Version )
42+ fmt .Printf ("%s version %v\n " , Name , version )
43+ if commit != "" {
44+ fmt .Printf ("commit: %s\n " , commit )
45+ }
46+ fmt .Printf ("built at: %s\n " , date )
47+ fmt .Printf ("built by: %s\n " , builtBy )
4148 flag .PrintDefaults ()
4249 if * hlp {
4350 os .Exit (0 )
Original file line number Diff line number Diff line change 11package main
22
3- //GitCommit The git commit that was compiled. This will be filled in by the compiler.
4- var GitCommit string
3+ // Version current app version
4+ // var Version = "dev"
5+ var (
6+ version = "dev"
7+ commit = ""
8+ date = ""
9+ builtBy = ""
10+ )
511
6- //Version current app version
7- var Version = "dev"
8-
9- //Name of the app
12+ // Name of the app
1013var Name = "ReAcT"
You can’t perform that action at this time.
0 commit comments