From 5ce1094b9003e64ba0a60f37ec1d117afd2d5489 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Wed, 16 Sep 2026 09:23:26 -0400 Subject: [PATCH] fix(release): make version bump re-runnable when already current Re-running make release for an already-bumped version died twice: the config.yml python asserted on change (no-op rewrite tripped it), and git commit would fail on an empty stage next. Now the python asserts only the pattern presence (real file-shape errors still abort) and prints already-at-version, and the commit step skips via git diff --cached when the stage is empty. Re-runs proceed to cliff notes and tagging instead of aborting. Proven both branches: already-current is a clean no-op, stale value bumps exactly line 13 with the schema version untouched. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5f118f2..dbcb2ae 100644 --- a/Makefile +++ b/Makefile @@ -44,9 +44,9 @@ release: # The regex targets only the indented info.version line, never the # top-level schema `version: '3'`. @echo "Bumping build/config.yml to $(VERSION)..." - @python3 -c "import re; p='build/config.yml'; s=open(p).read(); s2=re.sub(r'^ version: \"[^\"]*\"', ' version: \"$(VERSION)\"', s, count=1, flags=re.M); assert s2 != s, 'info.version not found'; open(p,'w').write(s2)" + @python3 -c "import re; p='build/config.yml'; s=open(p).read(); m=re.search(r'^ version: \"([^\"]*)\"', s, flags=re.M); assert m, 'info.version not found'; print('build/config.yml', m.group(1), '-> $(VERSION)' if m.group(1) != '$(VERSION)' else '(already at version)'); open(p,'w').write(re.sub(r'^ version: \"[^\"]*\"', ' version: \"$(VERSION)\"', s, count=1, flags=re.M))" @git add wails.json build/config.yml - @git commit -m "chore(release): bump version to $(VERSION)" + @git diff --cached --quiet && echo "versions already at $(VERSION), skipping bump commit" || git commit -m "chore(release): bump version to $(VERSION)" @echo "Generating release notes for $(VERSION)..." @git tag "$(VERSION)" HEAD && \ (git cliff --latest --config cliff.toml > .release-notes.tmp && git tag -d "$(VERSION)" >/dev/null) || \