Add the source release launcher

This commit is contained in:
2026-10-08 16:39:14 +00:00
parent ada2021583
commit 012af5e80a
4 changed files with 47 additions and 1 deletions

29
scripts/release Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/sh
set -eu
if [ "$#" -ne 1 ]; then
printf '%s\n' 'usage: ./scripts/release VERSION' >&2
exit 2
fi
release_version=$1
commandkit_root=$(CDPATH= cd "$(dirname "$0")/.." && pwd)
CDPATH= cd "$commandkit_root"
mkdir -p .releasekit/bin
commandkit_host_os=$(GOWORK=off GOTOOLCHAIN=local go env GOHOSTOS)
commandkit_host_arch=$(GOWORK=off GOTOOLCHAIN=local go env GOHOSTARCH)
GOOS="$commandkit_host_os" \
GOARCH="$commandkit_host_arch" \
GOWORK=off \
GOTOOLCHAIN=local \
go build \
-mod=readonly \
-o "$commandkit_root/.releasekit/bin/releasekit" \
gitea.maximumdirect.net/eric/ReleaseKit/cmd/releasekit
exec "$commandkit_root/.releasekit/bin/releasekit" publish \
--repo "$commandkit_root" \
--config "$commandkit_root/releasekit.json" \
"$release_version"