File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ builds:
2828 ignore :
2929 - goos : darwin
3030 goarch : ' 386'
31- binary : ' {{ .ProjectName }}_v{{ .Version }} '
31+ binary : ' kfutil '
3232archives :
3333- format : zip
3434 name_template : ' {{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
Original file line number Diff line number Diff line change @@ -6,7 +6,10 @@ NAMESPACE=keyfactor
66WEBSITE_REPO =https://github.com/Keyfactor/kfutil
77NAME =kfutil
88BINARY =${NAME}
9- VERSION =v0.0.4
9+ VERSION := $(GITHUB_REF_NAME )
10+ ifeq ($(VERSION ) ,)
11+ VERSION := $(shell git tag -l | tail -n 1)
12+ endif
1013OS_ARCH := $(shell go env GOOS) _$(shell go env GOARCH)
1114BASEDIR := ${HOME}/go/bin
1215INSTALLDIR := ${BASEDIR}
@@ -30,7 +33,7 @@ release:
3033 GOOS=windows GOARCH=386 go build -o ./bin/${BINARY} _${VERSION} _windows_386
3134 GOOS=windows GOARCH=amd64 go build -o ./bin/${BINARY} _${VERSION} _windows_amd64
3235
33- install :
36+ install : fmt setversion
3437 go build -o ${BINARY}
3538 rm -rf ${INSTALLDIR} /${BINARY}
3639 mkdir -p ${INSTALLDIR}
@@ -41,6 +44,12 @@ install:
4144vendor :
4245 go mod vendor
4346
47+ version :
48+ @echo ${VERSION}
49+
50+ setversion :
51+ sed -i ' ' -e ' s/VERSION = ".*"/VERSION = "$(VERSION)"/' pkg/version/version.go
52+
4453test :
4554 go test -i $(TEST ) || exit 1
4655 echo $(TEST ) | xargs -t -n4 go test $(TESTARGS ) -timeout=30s -parallel=4
@@ -54,4 +63,4 @@ prerelease:
5463 git tag $(VERSION )
5564 git push origin $(VERSION )
5665
57- .PHONY : build prerelease release install test fmt vendor
66+ .PHONY : build prerelease release install test fmt vendor version setversion
Original file line number Diff line number Diff line change 11package version
22
3- const VERSION = "v0.3.0 "
3+ const VERSION = "v0.4.1 "
You can’t perform that action at this time.
0 commit comments