Files

50 lines
1.4 KiB
Plaintext
Raw Permalink Normal View History

2026-10-08 16:39:14 +00:00
#!/bin/sh
set -eu
2026-10-11 01:54:04 +00:00
if [ "$#" -ne 2 ]; then
printf '%s\n' 'usage: ./scripts/release MODULE VERSION' >&2
2026-10-08 16:39:14 +00:00
exit 2
fi
2026-10-11 01:54:04 +00:00
case "$1" in
core)
commandkit_module_dir=.
commandkit_profile=releasekit.json
;;
ckconfig)
commandkit_module_dir=integrations/ckconfig
commandkit_profile=integrations/ckconfig/releasekit.json
;;
ckprompt)
commandkit_module_dir=integrations/ckprompt
commandkit_profile=integrations/ckprompt/releasekit.json
;;
*)
printf '%s\n' 'usage: ./scripts/release MODULE VERSION' >&2
exit 2
;;
esac
release_version=$2
2026-10-08 16:39:14 +00:00
commandkit_root=$(CDPATH= cd "$(dirname "$0")/.." && pwd)
CDPATH= cd "$commandkit_root"
2026-10-11 01:54:04 +00:00
mkdir -p "$commandkit_root/.releasekit/bin"
2026-10-08 16:39:14 +00:00
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
2026-10-11 01:54:04 +00:00
GOWORK=off GOTOOLCHAIN=local exec "$commandkit_root/.releasekit/bin/releasekit" publish \
2026-10-08 16:39:14 +00:00
--repo "$commandkit_root" \
2026-10-11 01:54:04 +00:00
--config "$commandkit_root/$commandkit_profile" \
--expected-module "$commandkit_module_dir" \
2026-10-08 16:39:14 +00:00
"$release_version"