From 6ed220a53c335b5fb78ce14c9020933d811c7ad7 Mon Sep 17 00:00:00 2001 From: George Angel Date: Mon, 23 Aug 2021 15:06:30 +0100 Subject: [PATCH] Let goreleaser handle versions --- Makefile | 8 -------- strongbox.go | 9 ++++++--- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index c129399..89db925 100644 --- a/Makefile +++ b/Makefile @@ -10,11 +10,3 @@ test: build-test-image bench: go test -bench=. - -release: - @sd "const version = \"dev\"" "const version = \"$(VERSION)\"" strongbox.go - @git add -- strongbox.go - @git commit -m "Release $(VERSION)" - @sd "const version = \"$(VERSION)\"" "const version = \"dev\"" strongbox.go - @git add -- strongbox.go - @git commit -m "Clean up release $(VERSION)" diff --git a/strongbox.go b/strongbox.go index 23bc745..9e26a44 100644 --- a/strongbox.go +++ b/strongbox.go @@ -21,9 +21,12 @@ import ( "github.com/jacobsa/crypto/siv" ) -const version = "dev" - var ( + version = "dev" + commit = "none" + date = "unknown" + builtBy = "unknown" + keyLoader = key kr keyRing prefix = []byte("# STRONGBOX ENCRYPTED RESOURCE ;") @@ -62,7 +65,7 @@ func main() { flag.Parse() if *flagVersion || (flag.NArg() == 1 && flag.Arg(0) == "version") { - fmt.Println(version) + fmt.Printf("version=%s commit=%s date=%s builtBy=%s", version, commit, date, builtBy) return }