Tolerate already published error for retrying (#40812)
This updates our `publish-native` script to tolerate the already published npm error so that we can retry publishing on an `npm` [service error like noticed here](https://github.com/vercel/next.js/actions/runs/3108335849/jobs/5037966318#step:10:2076). We probably want to migrate away from using `lerna` for publishing the non-swc packages as well so that we can retry there as well but will investigate that in a follow-up. x-ref: https://github.com/vercel/next.js/actions/runs/3108335849/jobs/5038069555
This commit is contained in:
parent
66ca4c21eb
commit
50b98d5081
1 changed files with 11 additions and 1 deletions
|
@ -46,8 +46,18 @@ const cwd = process.cwd()
|
|||
} catch (err) {
|
||||
// don't block publishing other versions on single platform error
|
||||
console.error(`Failed to publish`, platform)
|
||||
|
||||
if (
|
||||
err.message &&
|
||||
err.message.includes(
|
||||
'You cannot publish over the previously published versions'
|
||||
)
|
||||
) {
|
||||
console.error('Ignoring already published error', platform)
|
||||
} else {
|
||||
throw err
|
||||
}
|
||||
}
|
||||
// lerna publish in next step will fail if git status is not clean
|
||||
execSync(
|
||||
`git update-index --skip-worktree ${path.join(
|
||||
|
|
Loading…
Reference in a new issue