From f2a19aa709f564939a625cfcbcdd8563576cfce9 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Thu, 20 Aug 2026 13:47:43 +1000 Subject: [PATCH] chore(release-notes): unwrap hard-wrapped changelog text; fix [Unreleased] compare base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two release-notes hygiene items from the v2.3.0 cut: - release.yml now unwraps the extracted changelog section before publishing. CHANGELOG.md is hard-wrapped for the repo view, but GitHub renders release bodies with single newlines as
, so the v2.3.0 notes appeared as narrow ragged lines (corrected in place via gh release edit). Fenced blocks and nested bullets pass through. - The [Unreleased] compare link now starts from v2.3.0 instead of v2.2.0 — flagged by Copilot on the release-prep PR; without it the compare shows already-released changes. CONTRIBUTING.md's release steps gain the compare-link re-point and a note that wrapping changelog text is safe. Co-Authored-By: Claude Fable 5 --- .github/workflows/release.yml | 20 +++++++++++++++++++- CHANGELOG.md | 2 +- CONTRIBUTING.md | 5 ++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e6b2592f0..efd7c8c49 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,11 +53,29 @@ jobs: - name: Extract release notes from CHANGELOG.md run: | VERSION=$(node -p "require('./package.json').version") + # Second stage: unwrap hard-wrapped lines. CHANGELOG.md is wrapped for + # the repo view, but GitHub renders release bodies like comments — a + # single newline becomes
— so wrapped source shows as narrow + # ragged lines. Joins indented continuation lines into their bullet + # and consecutive "> " lines into one; fenced code blocks and nested + # bullets pass through untouched. awk -v ver="$VERSION" ' index($0, "## [" ver "]") == 1 { flag = 1; next } /^## / { flag = 0 } flag - ' CHANGELOG.md > release-notes.md + ' CHANGELOG.md | awk ' + function flush() { if (have) { print buf; have = 0 } } + /^```/ { flush(); print; infence = !infence; next } + infence { print; next } + /^ {2,}[^ ]/ && have && $0 !~ /^ +[-*] / { + line = $0; sub(/^ +/, "", line); buf = buf " " line; next + } + /^> [^ ]/ && have && buf ~ /^> / { + line = $0; sub(/^> /, "", line); buf = buf " " line; next + } + { flush(); buf = $0; have = 1 } + END { flush() } + ' > release-notes.md if ! grep -q '[^[:space:]]' release-notes.md; then echo "::error::CHANGELOG.md has no \"## [$VERSION]\" section — add the curated entry (see CONTRIBUTING.md \"Releases\") and re-tag." exit 1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 9929db00d..31d1be0a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -213,7 +213,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial version of the QuantEcon MyST theme: Remix + `@myst-theme` book theme with QuantEcon branding, toolbar (home, search, fullscreen, font scaling, dark mode, downloads, Colab/JupyterHub launch, edit-on-GitHub), content-driven site footer, and bundled brand assets. -[Unreleased]: https://github.com/QuantEcon/quantecon-theme.mystmd/compare/v2.2.0...HEAD +[Unreleased]: https://github.com/QuantEcon/quantecon-theme.mystmd/compare/v2.3.0...HEAD [2.3.0]: https://github.com/QuantEcon/quantecon-theme.mystmd/compare/v2.2.0...v2.3.0 [2.2.0]: https://github.com/QuantEcon/quantecon-theme.mystmd/compare/v2.1.0...v2.2.0 [2.1.0]: https://github.com/QuantEcon/quantecon-theme.mystmd/compare/v2.0.0...v2.1.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 343ad20da..cdb1620d7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -93,7 +93,10 @@ with a link to the PR. To cut a release: 1. In `CHANGELOG.md`, move the `## [Unreleased]` entries under a new `## [X.Y.Z] - YYYY-MM-DD` - heading and add the footer compare link. + heading, add the footer compare link, and re-point the `[Unreleased]` compare link's base + at the new tag (`compare/vX.Y.Z...HEAD`). + Wrapping the entry text is fine — the release workflow unwraps it, because GitHub renders + release bodies (unlike committed Markdown) with single newlines as line breaks. 2. Bump the version in `package.json` (e.g. `npm version X.Y.Z --no-git-tag-version`). You do **not** need to bump `template.yml` — the release workflow stamps its `version` from `package.json` into the published bundle, so the two cannot drift.