Adopt ReleaseKit module publishing

This commit is contained in:
2026-10-11 01:54:04 +00:00
parent e89cc2220f
commit 18e81a5579
9 changed files with 254 additions and 131 deletions

View File

@@ -1,16 +1,35 @@
#!/bin/sh
set -eu
if [ "$#" -ne 1 ]; then
printf '%s\n' 'usage: ./scripts/release VERSION' >&2
if [ "$#" -ne 2 ]; then
printf '%s\n' 'usage: ./scripts/release MODULE VERSION' >&2
exit 2
fi
release_version=$1
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
commandkit_root=$(CDPATH= cd "$(dirname "$0")/.." && pwd)
CDPATH= cd "$commandkit_root"
mkdir -p .releasekit/bin
mkdir -p "$commandkit_root/.releasekit/bin"
commandkit_host_os=$(GOWORK=off GOTOOLCHAIN=local go env GOHOSTOS)
commandkit_host_arch=$(GOWORK=off GOTOOLCHAIN=local go env GOHOSTARCH)
@@ -23,7 +42,8 @@ go build \
-o "$commandkit_root/.releasekit/bin/releasekit" \
gitea.maximumdirect.net/eric/ReleaseKit/cmd/releasekit
exec "$commandkit_root/.releasekit/bin/releasekit" publish \
GOWORK=off GOTOOLCHAIN=local exec "$commandkit_root/.releasekit/bin/releasekit" publish \
--repo "$commandkit_root" \
--config "$commandkit_root/releasekit.json" \
--config "$commandkit_root/$commandkit_profile" \
--expected-module "$commandkit_module_dir" \
"$release_version"