#!/bin/sh
# Build the hu13 release artifact at the tagged commit.
# Runs from the release worktree; VERSION and OUT come from f0rge.
set -eu
cargo build --release --locked
mkdir -p "$OUT"
tmp=$(mktemp -d)
trap 'rm -rf "$tmp"' EXIT INT TERM
stage="$tmp/hu13-${VERSION}"
mkdir -p "$stage"
cp target/release/hu13 "$stage/hu13"
cp LICENSE "$stage/"
cp .forge/wiki/README "$stage/README.md"
tar --owner=gl0w --group=gl0w -czf "$OUT/hu13-${VERSION}-linux-x86_64.tar.gz" -C "$tmp" "hu13-${VERSION}"
echo "built hu13-${VERSION}-linux-x86_64.tar.gz"
