feat: support tab-wide recording and release notes
CI / Test and build (push) Canceled after 0s

This commit is contained in:
go0p
2026-09-24 14:50:33 +08:00
parent 8c84e16012
commit d35912c7cf
22 changed files with 464 additions and 94 deletions
+6 -1
View File
@@ -65,6 +65,11 @@ const distDir = resolve(root, String(args.dist ?? 'dist'));
const pkg = JSON.parse(await readFile(resolve(root, 'package.json'), 'utf8'));
const { version } = pkg;
const notesByVersion = JSON.parse(await readFile(resolve(root, 'release-notes.json'), 'utf8'));
const notes = notesByVersion[version]?.map((note) => String(note).trim()).filter(Boolean);
if (!Array.isArray(notes) || notes.length === 0) {
throw new Error(`release-notes.json must contain at least one note for version ${version}`);
}
let commit = null;
try {
@@ -138,6 +143,6 @@ for (const target of VARIANTS) {
console.log(`packaged ${filename} (${size} bytes, sha256 ${sha256.slice(0, 12)}…)`);
}
const entry = { version, commit, built_at: new Date().toISOString(), artifacts };
const entry = { version, notes, commit, built_at: new Date().toISOString(), artifacts };
await writeFile(resolve(distDir, 'release-entry.json'), `${JSON.stringify(entry, null, 2)}\n`);
console.log(`release entry written: ${resolve(distDir, 'release-entry.json').slice(root.length + 1)} (version ${version})`);