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) || \