🌱🏠🧑‍💻 command line greenhouse client application: an interface to the greenhouse daemon https://greenhouse.server.garden/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

39 lines
1.0 KiB

#!/bin/bash -e
tag="0.0.0"
if git describe --tags --abbrev=0 > /dev/null 2>&1 ; then
tag="$(git describe --tags --abbrev=0)"
fi
version="$tag-$(git rev-parse --short HEAD)-$(hexdump -n 2 -ve '1/1 "%.2x"' /dev/urandom)"
function build() {
GOOS=$1
GOARCH=$2
echo "building version: $version for GOOS=$GOOS GOARCH=$GOARCH"
rm -rf build
mkdir build
GOOS=$GOOS GOARCH=$GOARCH go build -tags 'osusergo netgo' -ldflags='-extldflags=-static' -o build/greenhouse-cli
sha256sum build/greenhouse-cli
gzip_file_name="greenhouse-cli-$version-$GOOS-$GOARCH.gz"
gzip --stdout build/greenhouse-cli > "build/$gzip_file_name"
curl -X POST "https://picopublish.sequentialread.com/files/$gzip_file_name" \
-H 'Content-Type: application/x-gzip' -H "Authorization: Basic $(cat ~/.picopublish-auth)" \
--data-binary "@build/$gzip_file_name"
echo "https://picopublish.sequentialread.com/files/$gzip_file_name"
}
build linux amd64
build linux arm
build linux arm64
#build windows amd64
#build darwin amd64