Basefile install task now downloads the arch-matched binary from the Gitea release instead of compiling from source — avoids the multi-minute Go toolchain download and build inside the container. release.sh cross-builds linux/amd64 and linux/arm64, tags the version from Basefile, and uploads assets via tea. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
32 lines
771 B
Bash
Executable file
32 lines
771 B
Bash
Executable file
#!/bin/sh
|
|
set -eu
|
|
|
|
version=$(awk '/^version:/ {print $2; exit}' Basefile)
|
|
[ -n "$version" ] || { echo "no version in Basefile"; exit 1; }
|
|
|
|
if ! git diff --quiet || ! git diff --cached --quiet; then
|
|
echo "working tree is dirty"; exit 1
|
|
fi
|
|
|
|
if git rev-parse -q --verify "refs/tags/$version" >/dev/null; then
|
|
echo "tag $version already exists"; exit 1
|
|
fi
|
|
|
|
outdir=$(mktemp -d)
|
|
trap 'rm -rf "$outdir"' EXIT
|
|
|
|
for arch in amd64 arm64; do
|
|
GOOS=linux GOARCH="$arch" CGO_ENABLED=0 \
|
|
go build -trimpath -ldflags='-s -w' -o "$outdir/keys-linux-$arch" .
|
|
done
|
|
|
|
git tag "$version"
|
|
git push origin "$version"
|
|
|
|
tea release create \
|
|
--tag "$version" \
|
|
--title "$version" \
|
|
--asset "$outdir/keys-linux-amd64" \
|
|
--asset "$outdir/keys-linux-arm64"
|
|
|
|
echo "released $version"
|