// Builds a GitHub Release body for one version. CHANGELOG.md stays the // detailed record (Technical details included); the release body is the // short, user-facing version of the same section: // // ## Highlights <- .github/release-highlights/vX.Y.Z.md, if present // ## What's changed <- CHANGELOG.md section,
blocks stripped // ## Upgrading <- docker pull line, plus a note if migrations ran // Full changelog link <- previous tag ... this tag // // Usage: // node scripts/build-release-notes.mjs [previousTag] // node scripts/build-release-notes.mjs --check-highlights import { execFileSync } from "node:child_process"; import { existsSync, readFileSync } from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; const rootDir = path.dirname(path.dirname(fileURLToPath(import.meta.url))); export function highlightsPath(version) { return path.join(rootDir, ".github", "release-highlights", `v${version}.md`); } // HTML comments are stripped so the reminder template (all comments) counts // as "not written yet" rather than publishing an empty Highlights section. function stripHtmlComments(text) { let previous; do { previous = text; text = text.replace(//g, ""); } while (text !== previous); const unclosed = text.indexOf("