Guides
Releasing
How the npm + PyPI release is built and published from a single GitHub release.
Maintainers only. This page is about publishing a new version of becwright to npm and PyPI. If you’re using becwright, you never need this — install it with the commands in the Introduction.
becwright ships through three channels from a single GitHub release:
- PyPI — the Python package (
pip/pipx). - npm — a launcher package (
becwright) plus fiveos/cpu-gated platform packages (@becwright/<target>) that each carry a prebuilt binary, so users without Python can install it.
One-time setup
- PyPI: configured via Trusted Publishing (OIDC), no token stored. See the
pypijob in.github/workflows/release.yml. - npm:
- Create the
@becwrightscope/org on npm and ensure the account also owns the unscopedbecwrightname. - Add an automation access token as the
NPM_TOKENrepository secret.
- Create the
Cutting a release
- Bump the version in
pyproject.toml(the npm versions are derived from the git tag at publish time, so they don’t need editing). - Commit, then create a GitHub release whose tag is
vX.Y.Z(must matchpyproject.toml). - Publishing the release triggers
release.yml, which:- builds and smoke-tests the binary on all platforms (macOS as a universal2 binary),
- stages each binary into its
@becwright/<target>package (npm/stage.mjs), - sets every npm package version from the tag (
npm/set-version.mjs), - publishes the platform packages first, then the launcher,
- builds and publishes the Python package to PyPI.
Notes
- Platform packages are published before the launcher so the launcher’s
optionalDependenciesresolve immediately. npm publishis not idempotent: re-running for an already-published version fails. Bump the version to re-release.- To test binary builds without releasing, run the Build binaries workflow
manually (
workflow_dispatch).