added versioning
This commit is contained in:
parent
493dabb104
commit
9f7649049d
18
Makefile
Normal file
18
Makefile
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
BIN_NAME=hasshelper
|
||||||
|
PACKAGE_NAME=git.bloy.org/mike/hasshelper
|
||||||
|
GIT_DESCRIBE=$(shell git describe --always --long --dirty)
|
||||||
|
GIT_SEMVER=$(shell go run github.com/mdomke/git-semver)
|
||||||
|
LDFLAGS="-X main.gitDescribe=${GIT_DESCRIBE} -X main.gitVersion=${GIT_SEMVER}"
|
||||||
|
|
||||||
|
default: all
|
||||||
|
|
||||||
|
all: test build
|
||||||
|
|
||||||
|
build:
|
||||||
|
go build -ldflags ${LDFLAGS} -o bin/${BIN_NAME}
|
||||||
|
|
||||||
|
test:
|
||||||
|
go test ./... -ldflags ${LDFLAGS}
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf bin/${BIN_NAME}
|
||||||
4
go.mod
4
go.mod
@ -1,3 +1,7 @@
|
|||||||
module git.bloy.org/mike/hasshelper
|
module git.bloy.org/mike/hasshelper
|
||||||
|
|
||||||
go 1.18
|
go 1.18
|
||||||
|
|
||||||
|
require github.com/mdomke/git-semver v1.0.0
|
||||||
|
|
||||||
|
require github.com/stretchr/testify v1.7.1 // indirect
|
||||||
|
|||||||
12
go.sum
Normal file
12
go.sum
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
|
||||||
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/mdomke/git-semver v1.0.0 h1:cg/a+bI/D2EtPWlx4pKSUKz9G9bTOHEBdF2EjbV0b4s=
|
||||||
|
github.com/mdomke/git-semver v1.0.0/go.mod h1:fNw8giSaJDzhF/Gvxe7JSZJVDlkRR+/a8y1b3g6SGZ8=
|
||||||
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
|
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
|
||||||
|
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
||||||
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
14
main.go
Normal file
14
main.go
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
var gitDescribe = ""
|
||||||
|
var gitVersion = ""
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
fmt.Println("vim-go")
|
||||||
|
fmt.Println("getDescribe", gitDescribe)
|
||||||
|
fmt.Println("getVersion", gitVersion)
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user