release.sh: fix release notes extraction (empty notes in v0.2.0)
CI / Linux arm64 (push) Waiting to run
CI / Linux x86_64 (push) Waiting to run
CI / ASan + UBSan (push) Waiting to run

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WDASLCiN764v685boRVYar
This commit is contained in:
yann64andClaude Opus 5.5 committed 2026-11-28 20:09:05 +01:00
1 parent 1c1ccd631a
commit 114976b912
1 file changed
+5 -1
+5 -1
View File
@@ -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})"