Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve publish-release #55597

Merged
merged 3 commits into from Sep 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 12 additions & 9 deletions scripts/publish-release.js
Expand Up @@ -56,6 +56,8 @@ const cwd = process.cwd()
],
{ stdio: 'inherit' }
)
// Return here to avoid retry logic
return
} catch (err) {
console.error(`Failed to publish ${pkg}`, err)

Expand All @@ -69,21 +71,22 @@ const cwd = process.cwd()
return
}

if (retry < 3) {
const retryDelaySeconds = 15
console.log(`retrying in ${retryDelaySeconds}s`)
await new Promise((resolve) =>
setTimeout(resolve, retryDelaySeconds * 1000)
)
await publish(pkg, retry + 1)
if (retry >= 3) {
throw err
}
throw err
} finally {
publishSema.release()
}
// Recursive call need to be outside of the publishSema
const retryDelaySeconds = 15
console.log(`retrying in ${retryDelaySeconds}s`)
await new Promise((resolve) =>
setTimeout(resolve, retryDelaySeconds * 1000)
)
await publish(pkg, retry + 1)
}

await Promise.all(
await Promise.allSettled(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the idea here that we don't want to error if one of the packages doesn't publish?

Perhaps this should print the status so we know which ones rejected?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is that it should finish all packages even if one of them failed.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doe this relate to the jump to 13.5.0 release and related canary's?

packageDirs.map(async (packageDir) => {
const pkgJson = await readJson(
path.join(packagesDir, packageDir, 'package.json')
Expand Down