Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions build_release.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#! /usr/bin/env bash
#set -e

if [ $# -ne 2 ]; then
echo "need the version number and release comment as argument"
echo "e.g. ${0} 0.4.5 'fix local modules and modules with install_path purging bug #80 #82'"
if [ $# -ne 1 ]; then
echo "need the version number as argument to create the git tag"
echo "e.g. ${0} 0.4.5"
echo "Aborting..."
exit 1
fi
Expand Down Expand Up @@ -31,9 +31,6 @@ echo "pushing git tag v${1}"
git push -f --tags
git push

echo "creating github release v${1}"
github-release release --user xorpaul --repo ${projectname} --tag v${1} --name "v${1}" --description "${2}"

export CGO_ENABLED=0
export BUILDTIME=$(date -u '+%Y-%m-%d_%H:%M:%S')
export BUILDVERSION=$(git describe --tags)
Expand All @@ -42,20 +39,17 @@ export BUILDVERSION=$(git describe --tags)

echo "building and uploading ${projectname}-darwin-amd64"
env GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.buildtime=${BUILDTIME} -X main.buildversion=${BUILDVERSION}" && date
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
zip ${projectname}-v${1}-darwin-amd64.zip ${projectname}

### macOS ARM

echo "building and uploading ${projectname}-darwin-arm64"
env GOOS=darwin GOARCH=arm64 go build -ldflags "-X main.buildtime=${BUILDTIME} -X main.buildversion=${BUILDVERSION}" && date
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
zip ${projectname}-v${1}-darwin-arm64.zip ${projectname}

### LINUX

echo "building and uploading ${projectname}-linux-amd64"
go build -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.zip ${projectname}
github-release upload --user xorpaul --repo ${projectname} --tag v${1} --name "${projectname}-linux-amd64.zip" --file ${projectname}-linux-amd64.zip
zip ${projectname}-v${1}-linux-amd64.zip ${projectname}

Loading