From a849864169ed5766f9b552b67f1d301b8568b89a Mon Sep 17 00:00:00 2001 From: samzong Date: Sat, 12 Sep 2026 12:00:23 -0400 Subject: [PATCH] fix(release): bump examples/go and track go.work.sum on release The v0.1.4 release left examples/go/go.mod on v0.1.3 while go-cobra/go.mod moved to v0.1.4. The workspace then had to resolve two versions of the same dependency, so every go command rewrote go.work.sum to the higher one and the file was permanently dirty. prepare-release.mjs only knew about go-cobra/go.mod, so the drift would reappear on the next release. It now bumps both modules through the same replaceOne, and carries go.work.sum in changedFiles: make check runs before git add and rewrites that file, so leaving it out reopened the same gap. Deleting go.work.sum and letting the toolchain regenerate it reproduces the committed line exactly, and a full check.mjs run no longer leaves it dirty. Signed-off-by: samzong --- examples/go/go.mod | 2 +- go.work.sum | 2 +- scripts/prepare-release.mjs | 16 +++++++++++----- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/examples/go/go.mod b/examples/go/go.mod index a0e6288..09d2147 100644 --- a/examples/go/go.mod +++ b/examples/go/go.mod @@ -2,4 +2,4 @@ module kitup-example-go go 1.23 -require github.com/lathe-cli/kitup/go v0.1.3 +require github.com/lathe-cli/kitup/go v0.1.4 diff --git a/go.work.sum b/go.work.sum index 9fc6cf3..5bb27c5 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1 +1 @@ -github.com/lathe-cli/kitup/go v0.1.3/go.mod h1:dZgJDmFRKjaFBZyaP1qlzOB9IEafnf1/ai4KX4hMA4c= +github.com/lathe-cli/kitup/go v0.1.4/go.mod h1:dZgJDmFRKjaFBZyaP1qlzOB9IEafnf1/ai4KX4hMA4c= diff --git a/scripts/prepare-release.mjs b/scripts/prepare-release.mjs index 9f10fbd..d5a1bfa 100755 --- a/scripts/prepare-release.mjs +++ b/scripts/prepare-release.mjs @@ -26,6 +26,8 @@ const bump = positional[0]; const packagePath = "ts/package.json"; const cargoPath = "rust/Cargo.toml"; const goCobraModPath = "go-cobra/go.mod"; +const exampleGoModPath = "examples/go/go.mod"; +const goWorkSumPath = "go.work.sum"; const rustLockPath = "rust/Cargo.lock"; const exampleRustLockPath = "examples/rust/Cargo.lock"; const pythonPackagePath = "python/pyproject.toml"; @@ -42,6 +44,8 @@ const changedFiles = [ rustLockPath, exampleRustLockPath, goCobraModPath, + exampleGoModPath, + goWorkSumPath, pythonPackagePath, pythonLockPath, examplePythonLockPath, @@ -60,11 +64,13 @@ replaceOne( /^version = "([^"]+)"$/m, `version = "${nextVersion}"`, ); -replaceOne( - goCobraModPath, - /(github\.com\/lathe-cli\/kitup\/go\s+)v\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?/, - `$1${tag}`, -); +for (const path of [goCobraModPath, exampleGoModPath]) { + replaceOne( + path, + /(github\.com\/lathe-cli\/kitup\/go\s+)v\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?/, + `$1${tag}`, + ); +} if (dryRun) { console.log(`Would create branch: ${branch}`);