From b94ed6665bb5955e9bde9a7391d77848f086ecf2 Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Tue, 3 Nov 2026 15:45:15 +0000 Subject: [PATCH] Centralize release tool invocation --- docs/roadmap/implementation.md | 6 ++++- scripts/release | 43 ++----------------------------- scripts/releasekit | 46 ++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 42 deletions(-) create mode 100755 scripts/releasekit diff --git a/docs/roadmap/implementation.md b/docs/roadmap/implementation.md index 185a5d7..c421da6 100644 --- a/docs/roadmap/implementation.md +++ b/docs/roadmap/implementation.md @@ -1,6 +1,6 @@ # Release tooling implementation plan -Status: Stage 1 complete; Stages 2–6 pending. +Status: Stages 1–2 complete; Stages 3–6 pending. Follow the stages in integer order. This is one end-to-end sprint: intermediate stages may temporarily leave scripts, tests, and documentation inconsistent. @@ -80,6 +80,10 @@ entirely by the existing upstream profile schema. ## Stage 2: Centralize tool invocation and module routing +**Completed.** Both scripts pass shell syntax checks; a fake Go invocation +confirmed representative publication and raw-command forwarding. Focused +coverage follows in Stage 3. + Create executable POSIX-shell `scripts/releasekit` as the shared entry point. Keep executable `scripts/release` as the existing publication convenience entry point. No shell library, module-map file, generated script, or JSON parser is diff --git a/scripts/release b/scripts/release index 6231fca..441e9c9 100755 --- a/scripts/release +++ b/scripts/release @@ -6,44 +6,5 @@ if [ "$#" -ne 2 ]; then exit 2 fi -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 "$commandkit_root/.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" \ - go.maximumdirect.net/releasekit/cmd/releasekit - -GOWORK=off GOTOOLCHAIN=local exec "$commandkit_root/.releasekit/bin/releasekit" publish \ - --repo "$commandkit_root" \ - --config "$commandkit_root/$commandkit_profile" \ - --expected-module "$commandkit_module_dir" \ - "$release_version" +script_dir=$(CDPATH= cd "$(dirname "$0")" && pwd) +exec "$script_dir/releasekit" "$1" publish "$2" diff --git a/scripts/releasekit b/scripts/releasekit new file mode 100755 index 0000000..c451810 --- /dev/null +++ b/scripts/releasekit @@ -0,0 +1,46 @@ +#!/bin/sh +set -eu + +usage() { + printf '%s\n' 'usage: releasekit MODULE {publish|check|deliver} [ARGS...] | releasekit {version|publication-attempts|reconcile} [ARGS...]' >&2 + exit 2 +} + +[ "$#" -ge 1 ] || usage +case "$1" in + core) module_dir=.; profile=releasekit.json ;; + ckconfig) module_dir=integrations/ckconfig; profile=integrations/ckconfig/releasekit.json ;; + ckprompt) module_dir=integrations/ckprompt; profile=integrations/ckprompt/releasekit.json ;; + version|publication-attempts|reconcile) module_dir= ;; + *) usage ;; +esac + +if [ -n "$module_dir" ]; then + shift + [ "$#" -ge 1 ] || usage + operation=$1 + shift + case "$operation" in + publish|check|deliver) ;; + *) usage ;; + esac +fi + +root=$(CDPATH= cd "$(dirname "$0")/.." && pwd) +CDPATH= cd "$root" +GOWORK=off +GOTOOLCHAIN=local +export GOWORK GOTOOLCHAIN +GOOS=$(go env GOHOSTOS) +GOARCH=$(go env GOHOSTARCH) +GOFLAGS="$(go env GOFLAGS) -mod=readonly" +export GOOS GOARCH GOFLAGS + +if [ -n "$module_dir" ]; then + if [ "$operation" = publish ]; then + set -- "$operation" --repo "$root" --config "$root/$profile" --expected-module "$module_dir" "$@" + else + set -- "$operation" --repo "$root" --config "$root/$profile" "$@" + fi +fi +exec go tool go.maximumdirect.net/releasekit/cmd/releasekit "$@"