From a2afbd7f6f594854af9736c03f2a1b7893b49302 Mon Sep 17 00:00:00 2001 From: Roman Pertl Date: Thu, 1 Sep 2022 14:48:41 +0200 Subject: [PATCH 1/2] fix broken BULDTIME in releases builds --- build_release.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build_release.sh b/build_release.sh index cc7aa8c..c139704 100755 --- a/build_release.sh +++ b/build_release.sh @@ -36,13 +36,13 @@ upx=`which upx` if [ ${#upx} -gt 0 ]; then echo "building and uploading ${projectname}-darwin-amd64-debug" - BUILDTIME=$(date -u '+%Y-%m-%d_%H:%M:%S') BUILDVERSION=$(git describe --tags) && env GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.buildtime=$BUILDTIME_v${1} -X main.buildversion=${BUILDVERSION}" && date + BUILDTIME=$(date -u '+%Y-%m-%d_%H:%M:%S') BUILDVERSION=$(git describe --tags) && env GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.buildtime=${BUILDTIME} -X main.buildversion=${BUILDVERSION}" && date zip ${projectname}-darwin-amd64-debug.zip ${projectname} github-release upload --user xorpaul --repo ${projectname} --tag v${1} --name "${projectname}-darwin-amd64-debug.zip" --file ${projectname}-darwin-amd64-debug.zip fi echo "building and uploading ${projectname}-darwin-amd64" -BUILDTIME=$(date -u '+%Y-%m-%d_%H:%M:%S') BUILDVERSION=$(git describe --tags) && env GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w -X main.buildtime=$BUILDTIME_v${1} -X main.buildversion=${BUILDVERSION}" && date +BUILDTIME=$(date -u '+%Y-%m-%d_%H:%M:%S') BUILDVERSION=$(git describe --tags) && env GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w -X main.buildtime=${BUILDTIME} -X main.buildversion=${BUILDVERSION}" && date if [ ${#upx} -gt 0 ]; then $upx --brute ${projectname} fi @@ -55,13 +55,13 @@ github-release upload --user xorpaul --repo ${projectname} --tag v${ if [ ${#upx} -gt 0 ]; then echo "building and uploading ${projectname}-linux-amd64-debug" - BUILDTIME=$(date -u '+%Y-%m-%d_%H:%M:%S') BUILDVERSION=$(git describe --tags) && go build -race -ldflags "-X main.buildtime=$BUILDTIME_v${1} -X main.buildversion=${BUILDVERSION}" && date && env ${projectname}_cachedir=/tmp/${projectname} ./${projectname} -config test.yaml -branch benchmark 2>&1 + BUILDTIME=$(date -u '+%Y-%m-%d_%H:%M:%S') BUILDVERSION=$(git describe --tags) && go build -race -ldflags "-X main.buildtime=${BUILDTIME} -X main.buildversion=${BUILDVERSION}" && date && env ${projectname}_cachedir=/tmp/${projectname} ./${projectname} -config test.yaml -branch benchmark 2>&1 zip ${projectname}-linux-amd64-debug.zip ${projectname} github-release upload --user xorpaul --repo ${projectname} --tag v${1} --name "${projectname}-linux-amd64-debug.zip" --file ${projectname}-linux-amd64-debug.zip fi echo "building and uploading ${projectname}-linux-amd64" -BUILDTIME=$(date -u '+%Y-%m-%d_%H:%M:%S') BUILDVERSION=$(git describe --tags) && go build -race -ldflags "-s -w -X main.buildtime=$BUILDTIME_v${1} -X main.buildversion=${BUILDVERSION}" && date && env ${projectname}_cachedir=/tmp/${projectname} ./${projectname} -config test.yaml -branch benchmark 2>&1 +BUILDTIME=$(date -u '+%Y-%m-%d_%H:%M:%S') BUILDVERSION=$(git describe --tags) && go build -race -ldflags "-s -w -X main.buildtime=${BUILDTIME} -X main.buildversion=${BUILDVERSION}" && date && env ${projectname}_cachedir=/tmp/${projectname} ./${projectname} -config test.yaml -branch benchmark 2>&1 if [ ${#upx} -gt 0 ]; then $upx --brute ${projectname} fi From 250629558bff709db46d85ef9278dc495ab0fa05 Mon Sep 17 00:00:00 2001 From: Roman Pertl Date: Thu, 1 Sep 2022 17:31:38 +0200 Subject: [PATCH 2/2] adding darwin arm64 build --- build_release.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/build_release.sh b/build_release.sh index c139704..5167565 100755 --- a/build_release.sh +++ b/build_release.sh @@ -50,6 +50,21 @@ zip ${projectname}-darwin-amd64.zip ${projectname} github-release upload --user xorpaul --repo ${projectname} --tag v${1} --name "${projectname}-darwin-amd64.zip" --file ${projectname}-darwin-amd64.zip +if [ ${#upx} -gt 0 ]; then + echo "building and uploading ${projectname}-darwin-arm64-debug" + BUILDTIME=$(date -u '+%Y-%m-%d_%H:%M:%S') BUILDVERSION=$(git describe --tags) && env GOOS=darwin GOARCH=arm64 go build -ldflags "-X main.buildtime=${BUILDTIME} -X main.buildversion=${BUILDVERSION}" && date + zip ${projectname}-darwin-arm64-debug.zip ${projectname} + github-release upload --user xorpaul --repo ${projectname} --tag v${1} --name "${projectname}-darwin-arm64-debug.zip" --file ${projectname}-darwin-arm64-debug.zip +fi + +echo "building and uploading ${projectname}-darwin-arm64" +BUILDTIME=$(date -u '+%Y-%m-%d_%H:%M:%S') BUILDVERSION=$(git describe --tags) && env GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w -X main.buildtime=${BUILDTIME} -X main.buildversion=${BUILDVERSION}" && date +if [ ${#upx} -gt 0 ]; then + $upx --brute ${projectname} +fi +zip ${projectname}-darwin-arm64.zip ${projectname} +github-release upload --user xorpaul --repo ${projectname} --tag v${1} --name "${projectname}-darwin-arm64.zip" --file ${projectname}-darwin-arm64.zip +