Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <br> — 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
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading