diff --git a/MINOR b/MINOR index f6b91e0..900731f 100644 --- a/MINOR +++ b/MINOR @@ -1 +1 @@ -56 +64 diff --git a/Makefile b/Makefile index b2a5fb6..5124b5e 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,13 @@ +include: VERSION + all: - ./version.sh go build -v -ldflags "-X main.buildstamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` -X main.githash=`git rev-parse HEAD`" || exit clean: rm -- certsquirt -release: all +release: + ./version.sh ./release.sh realclean: diff --git a/VERSION b/VERSION index 6bfc029..b1da184 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.56 +0.9.64 diff --git a/main.go b/main.go index c0b1406..dcb0f17 100644 --- a/main.go +++ b/main.go @@ -80,7 +80,11 @@ func main() { flag.BoolVar(&flShowVersion, "version", false, "Show version information, and quit.") flag.Parse() if flShowVersion { - log.Printf("VERSION: Running version %v built at %v. (githash: %v)", version, buildstamp, githash) + if buildstamp != "" && githash != "" { + log.Printf("VERSION: Running version %v built at %v. (githash: %v)", version, buildstamp, githash) + } else { + log.Printf("VERSION: Running release version %v", version) + } os.Exit(0) } if flUsage { diff --git a/release.sh b/release.sh index 6c20e60..b3bb530 100755 --- a/release.sh +++ b/release.sh @@ -1,2 +1,12 @@ export VERSION=`cat VERSION` git archive --prefix=certsquirt-${VERSION}/ --format=tar.gz --output=certsquirt-${VERSION}.tar.gz main + +# assume building on MacOS +go build -v -ldflags "-X main.buildstamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` -X main.githash=`git rev-parse HEAD`" -o certsquirt-${VERSION}-macos-arm +GOOS=windows GOARCH=amd64 go build -a -v -ldflags "-X main.buildstamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` -X main.githash=`git rev-parse HEAD`" -o certsquirt-${VERSION}-windows-amd64.exe +GOOS=linux GOARCH=amd64 go build -a -v -ldflags "-X main.buildstamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` -X main.githash=`git rev-parse HEAD`" -o certsquirt-${VERSION}-linux-amd64 +GOOS=linux GOARCH=arm64 go build -a -v -ldflags "-X main.buildstamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` -X main.githash=`git rev-parse HEAD`" -o certsquirt-${VERSION}-linux-arm64 +GOOS=freebsd GOARCH=amd64 go build -a -v -ldflags "-X main.buildstamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` -X main.githash=`git rev-parse HEAD`" -o certsquirt-${VERSION}-freebsd-amd64 +GOOS=freebsd GOARCH=arm64 go build -a -v -ldflags "-X main.buildstamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` -X main.githash=`git rev-parse HEAD`" -o certsquirt-${VERSION}-freebsd-arm64 +GOOS=openbsd GOARCH=amd64 go build -a -v -ldflags "-X main.buildstamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` -X main.githash=`git rev-parse HEAD`" -o certsquirt-${VERSION}-openbsd-amd64 +GOOS=openbsd GOARCH=arm64 go build -a -v -ldflags "-X main.buildstamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` -X main.githash=`git rev-parse HEAD`" -o certsquirt-${VERSION}-openbsd-arm64 diff --git a/version.sh b/version.sh index 0e81c04..8080f90 100755 --- a/version.sh +++ b/version.sh @@ -1,7 +1,6 @@ #!/bin/sh MINOR=`cat MINOR` NEWMINOR=`expr ${MINOR} + 1` -VERSION=0.9.${NEWMINOR} +export VERSION=0.9.${NEWMINOR} echo $VERSION > VERSION echo $NEWMINOR > MINOR -export VERSION