ci: the background acceptance jobs start after the Linux and Windows installer builds (0.8.13's Windows installer waited behind six acceptance jobs on the one Windows runner); release: an npm deprecation already set by an earlier npm-publish run (422) is not an error

This commit is contained in:
CRTkafa 2026-10-18 13:38:26 +07:00
parent d006f8d932
commit 3e4015b686
2 changed files with 6 additions and 2 deletions

View file

@ -76,8 +76,10 @@ jobs:
# npm tarball, in fresh temp folders with piped stdin and the fake stores, on Linux and Windows x Node 20 / Node 22
# (npx --package=<tgz>) / Bun (bun x). One red cell and the commit is no candidate. macOS runs on the owner's Mac
# (tools/release.ts, cached per CLI key).
# after the installers: the one Windows runner builds the release installer first, the background tests wait
# (0.8.13's Windows installer queued behind six acceptance jobs)
acceptance:
needs: gate
needs: [gate, linux, windows]
if: github.event_name != 'pull_request' || true
strategy:
fail-fast: false

View file

@ -455,7 +455,9 @@ async function npmRelease(version: string, token: string): Promise<void> {
await new Promise(res => setTimeout(res, 5_000));
}
const dep = npmRun(['deprecate', `storebound@<${version}`, `storebound ${version} is out: npx storebound@${version}`], token);
if (dep.code !== 0) fail(`npm deprecate failed: ${dep.out.trim().split('\n').slice(-3).join(' ')}`);
// a deprecation that is already set (an earlier npm-publish run) answers 422: fine when the message is the same
if (dep.code !== 0 && /E422|Unprocessable/i.test(dep.out) && (spawnSync('npm', ['view', `storebound@<${version}`, 'deprecated'], { encoding: 'utf8', timeout: 30_000 }).stdout ?? '').includes(`storebound ${version} is out`)) say('npm: older versions were already deprecated');
else if (dep.code !== 0) fail(`npm deprecate failed: ${dep.out.trim().split('\n').slice(-3).join(' ')}`);
say(`npm: storebound@${version} published and older versions deprecated`);
}