tldraw/scripts/lib
David Sheldrick 0556b140de
[infra] maybe fix canary publish (#1950)
This last day or two our npm publish script has been randomly failing
due to npm flakiness. I'm seeing the following error:

Failed to save packument. A common cause is if you try to publish a new
package before the previous package has been fully processed.

This doesn't seem to be our fault since we're publishing things in the
right order, the version numbers and package.json files are all correct,
and we're waiting for things to appear in the registry after publishing
before moving on to the next package.

So I'm thinking maybe npm is a little tired right now or something and
needs a little extra time to handle things.

So I've wrapped our publish command inside a retry block.

At the same time I noticed that the `--tolerate-republish` flag does not
seem to be working for canary version numbers, so I've added some extra
logic for that too. Hopefully this means if things fail due to
persistent npm flake we can just run the action again.

### Change Type

- [ ] `patch` — Bug fix
- [ ] `minor` — New feature
- [ ] `major` — Breaking change
- [ ] `dependencies` — Changes to package dependencies[^1]
- [ ] `documentation` — Changes to the documentation only[^2]
- [ ] `tests` — Changes to any test code only[^2]
- [x] `internal` — Any other changes that don't affect the published
package[^2]
- [ ] I don't know

[^1]: publishes a `patch` release, for devDependencies use `internal`
[^2]: will not publish a new version
2023-09-26 15:36:32 +00:00
..
add-extensions.ts transfer-out: transfer out 2023-04-25 12:01:25 +01:00
eslint-plugin.ts transfer-out: transfer out 2023-04-25 12:01:25 +01:00
exec.ts replace console.log with nicelog (#1496) 2023-06-01 18:01:49 +00:00
file.ts [1/2] Move docs to brivate (#1640) 2023-06-23 14:23:14 +00:00
nicelog.ts replace console.log with nicelog (#1496) 2023-06-01 18:01:49 +00:00
publishing.ts [infra] maybe fix canary publish (#1950) 2023-09-26 15:36:32 +00:00
sort-unions.ts transfer-out: transfer out 2023-04-25 12:01:25 +01:00
workspace.ts transfer-out: transfer out 2023-04-25 12:01:25 +01:00