From 950ef5b706af525d487496d2fc59bc59fc12aa48 Mon Sep 17 00:00:00 2001 From: byGalax Date: Wed, 6 May 2026 23:45:10 +0200 Subject: [PATCH] chore(release): inject releaseNotes into latest.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- scripts/release.mjs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/scripts/release.mjs b/scripts/release.mjs index a58f150..02343ac 100644 --- a/scripts/release.mjs +++ b/scripts/release.mjs @@ -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}`;