release: a staged npm publish found on the retry is reported as waiting for the maintainer's approval instead of failing after 5 minutes

This commit is contained in:
CRTkafa 2026-10-22 02:17:28 +08:00
parent f7dd646e57
commit a8a889fb35

View file

@ -481,6 +481,8 @@ async function npmRelease(version: string, token: string): Promise<void> {
again = true;
say(`npm: ${version} is not on the registry yet: publishing once more`);
const p2 = npmRun(['publish'], token);
// 0.8.25: the first publish was staged silently; the retry's 409 "previously staged" says so (no 5-minute wait)
if (/staged/i.test(p2.out)) { say(`npm: ${version} is staged and waits for the maintainer's approval: https://www.npmjs.com/package/storebound (approve it there; then deprecate runs with: bun tools/release.ts npm-publish)`); return; }
if (p2.code !== 0 && !/previously published|cannot publish over/i.test(p2.out)) fail(`npm publish (second try) failed: ${p2.out.trim().split('\n').slice(-4).join(' ')}`);
}
}