chore(release): inject releaseNotes into latest.yml
electron-builder doesn't write CLI-supplied --notes into the auto-update manifest, so clients saw an empty body in UpdateToast even when the release script logged notes. After the build but before scp, patch latest.yml in place: append a block scalar (`releaseNotes: |-`) so multi-line notes survive intact. Idempotent — skips if a releaseNotes entry is already present (reruns / hand-edited manifests). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -104,6 +104,29 @@ for (const p of [exePath, blockmapPath, latestYmlPath]) {
|
||||
}
|
||||
}
|
||||
|
||||
// --- Inject releaseNotes into latest.yml ----------------------------------
|
||||
//
|
||||
// electron-builder doesn't write the CLI-supplied notes into the
|
||||
// manifest by default — clients then see an empty body in the
|
||||
// UpdateToast. Patch the YAML in place: append a block scalar
|
||||
// (`releaseNotes: |-`) so multi-line content survives intact.
|
||||
// Idempotent — skip if a `releaseNotes:` entry is already present
|
||||
// (covers reruns / hand-edited manifests).
|
||||
{
|
||||
let yml = readFileSync(latestYmlPath, 'utf8');
|
||||
if (!/^releaseNotes:/m.test(yml)) {
|
||||
const indented = notes
|
||||
.split('\n')
|
||||
.map((l) => ' ' + l)
|
||||
.join('\n');
|
||||
yml = yml.replace(/\s*$/, '') + `\nreleaseNotes: |-\n${indented}\n`;
|
||||
writeFileSync(latestYmlPath, yml, 'utf8');
|
||||
console.log('Injected releaseNotes into latest.yml');
|
||||
} else {
|
||||
console.log('latest.yml already has releaseNotes — skipping injection');
|
||||
}
|
||||
}
|
||||
|
||||
// --- scp helpers ----------------------------------------------------------
|
||||
|
||||
const sshTarget = `${env.UPDATE_SSH_USER}@${env.UPDATE_HOST}`;
|
||||
|
||||
Reference in New Issue
Block a user