fork of 🔒 https://github.com/caddyserver/caddy because I wanted simpler TLS on the admin API listener
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.

34 lines
901 B

#!/bin/bash -e
function build() {
GOOS=$1
GOARCH=$2
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)"
echo "building version: $version"
rm -rf build
mkdir build
go build -v -tags 'osusergo netgo' -ldflags='-extldflags=-static' -o build/caddy ./cmd/caddy
sha256sum build/caddy
gzip_file_name="caddy-$version-$GOOS-$GOARCH.gz"
gzip --stdout build/caddy > "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 arm
build linux amd64
#build arm64