diff --git a/docs/releasing.md b/docs/releasing.md index 05c50f978..b1862ca7c 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -176,7 +176,7 @@ The releaser accepts these flags: - `--tag ` -- publish with a specific npm dist-tag (e.g., `canary`, `snapshot`); defaults to `latest` - `--version ` -- override the version read from `package.json` -All publishes are idempotent -- the script checks the registry before publishing and skips already-published versions, and a publish that npm rejects because the version already exists counts as done. The check reads the per-version document (`registry.npmjs.org//`), which the registry CDN does not cache, so a version published seconds earlier is visible right away. Before publishing the `clerk` wrapper, the script waits (up to five minutes) for every platform package to be readable. If one platform publish fails, the others still run to completion before the job exits, so a re-run only has to publish what is actually missing. +All publishes are idempotent -- the script checks the registry before publishing and skips already-published versions, and a publish that npm rejects because the version already exists counts as done. The check reads the per-version document (`registry.npmjs.org//`), which the registry CDN does not cache, but npm can still take several minutes to serve a new version back. Before publishing the `clerk` wrapper, the script waits up to two minutes for every platform package to be readable; if one is still unreadable after that, it logs a warning and publishes the wrapper anyway, because npm already accepted every platform publish. If one platform publish fails, the others still run to completion before the job exits, so a re-run only has to publish what is actually missing. #### Environment Variables diff --git a/scripts/releaser.ts b/scripts/releaser.ts index 527d352c3..27e24f1ff 100644 --- a/scripts/releaser.ts +++ b/scripts/releaser.ts @@ -105,12 +105,21 @@ await publishDependenciesBeforePackage( waitUntilAvailable: dryRun ? undefined : async () => { + // Best effort. npm accepted the publish, so the version exists; the + // registry can take several minutes to serve it back (observed + // >5 min on the uncached per-version endpoint). Failing here only + // strands the wrapper, which is subject to the same read lag. console.log(`Waiting for ${name}@${version} to become available on npm...`); - await waitUntilPublished(name, version, { - intervalMs: 5_000, - timeoutMs: 300_000, - isPublished, - }); + try { + await waitUntilPublished(name, version, { + intervalMs: 5_000, + timeoutMs: 120_000, + isPublished, + }); + } catch (error) { + const reason = error instanceof Error ? error.message : String(error); + console.log(`::warning::${reason}; continuing because npm accepted the publish`); + } }, }; }),