Skip to content

Commit

Permalink
Tolerate already published error for retrying (#40812)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ijjk committed Sep 22, 2022
1 parent 66ca4c2 commit 50b98d5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/publish-native.js
Expand Up @@ -46,7 +46,17 @@ const cwd = process.cwd()
} catch (err) {
// don't block publishing other versions on single platform error
console.error(`Failed to publish`, platform)
throw err

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(
Expand Down

0 comments on commit 50b98d5

Please sign in to comment.