🌱🏠😈 Common background service doing the heavy lifting for various user-facing greenhouse client applications 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.

38 lines
1.0 KiB

#!/bin/bash -e
if git describe --tags --abbrev=0 > /dev/null 2>&1 ; then
tag="$(git describe --tags --abbrev=0)"
version="$tag-$(git rev-parse --short HEAD)-$(hexdump -n 2 -ve '1/1 "%.2x"' /dev/urandom)"
function build() {
echo "building version: $version GOOS=$GOOS GOARCH=$GOARCH"
rm -rf build
mkdir build
GOOS=$GOOS GOARCH=$GOARCH go build -tags 'osusergo netgo' -ldflags='-extldflags=-static' -o "build/greenhouse-daemon"
sha256sum "build/greenhouse-daemon"
gzip --stdout "build/greenhouse-daemon" > "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 arm64
build darwin amd64