From 114976b9125181747915ab3f14cdaf713821189c Mon Sep 17 00:00:00 2001 From: yann64 Date: Sat, 28 Nov 2026 20:09:05 +0100 Subject: [PATCH] release.sh: fix release notes extraction (empty notes in v0.2.0) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01WDASLCiN764v685boRVYar --- tools/release.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/release.sh b/tools/release.sh index 649e0c0..a5d642c 100644 --- a/tools/release.sh +++ b/tools/release.sh @@ -28,7 +28,11 @@ sed -i "s|^\[Unreleased\]: \(.*\)/compare/v[0-9.]*\.\.\.HEAD$|[Unreleased]: \1/c git add CMakeLists.txt CHANGELOG.md # RELEASE_TRAILER: optional trailer lines appended to the release commit message (e.g. co-authors). git commit -q -m "release: v$VERSION" ${RELEASE_TRAILER:+-m "$RELEASE_TRAILER"} -NOTES=$(awk -v v="$VERSION" '$0 ~ "^## \\[" v "\\]" {on=1; next} on && /^(## |\[)/ {exit} on {print}' CHANGELOG.md) +# Plain string comparison (not a regex: "[" and "." in the heading would be special). +NOTES=$(awk -v v="$VERSION" 'index($0, "## [" v "]") == 1 {on=1; next} + on && (index($0, "## ") == 1 || index($0, "[") == 1) {exit} + on {print}' CHANGELOG.md | sed -e '/./,$!d') +[ -n "$NOTES" ] || { echo "no release notes found for $VERSION in CHANGELOG.md" >&2; exit 1; } git tag -a "v$VERSION" -m "OpenPU $VERSION" -m "$NOTES" echo "tagged v$VERSION (previous: ${PREVIOUS:-none})"