Add stable v4 release automation

Merged
MO
3mo ago
+1490-50

Now that the v4 package names and versions are established, this PR adds the stable release flow for the TypeScript and Python SDKs.

  • just changeset records the release intent for a pull request.
  • just _version is used by CI to apply those changes, keep the Python version in sync, and update the root changelog.
  • Changesets maintains the release pull request on main.
  • Merging that release pull request publishes the TypeScript SDK to npm and the Python SDK to PyPI.

The private protocol package is also versioned through Changesets because its major version is the compatibility contract between the SDK and extension, but it is not published to npm.

We keep one root CHANGELOG.md for the repository, beginning with the existing v3 history. The release workflows only run from main, so this stack cannot publish anything.


Summary by cubic

Adds stable v4 release automation for the TypeScript and Python SDKs. On pushes to main, we open a release PR or publish TS to npm, and publish Python to PyPI only when a new version is needed (skips if pending Changesets exist).

  • New Features

    • Adopted changesets for @browserbasehq/stagehand, @browserbasehq/stagehand-python, and versioned private @browserbasehq/stagehand-protocol (not published).
    • Release workflow on main: runs just check/just build, opens a release PR via changesets/action, publishes TS via just _publish-typescript, then uses a status check to publish Python only if PyPI is missing the version and no Changesets are pending.
    • Reusable Python workflow: builds wheels/sdists, smoke-tests with uv, uses trusted publishing, and tags stagehand-python@<version>.
    • Consolidated SDK changelogs into the root CHANGELOG.md with SDK-labeled headings; package changelogs are temporary and removed in CI.
    • Added release scripts and just tasks to validate Changesets (allowed packages only), consolidate changelogs, sync Python version from the proxy package.json, verify uv.lock, gate Python publishing on PyPI status, and clean stale dist/ artifacts (including legacy names).
    • Documented the release flow and contributor steps in README.md.
  • Migration

    • When a PR changes a public SDK or the protocol contract, run just changeset. Internal-only changes don’t need one.
    • Merge the release PR on main to publish TypeScript; Python auto-publishes if the synchronized version is not on PyPI. Release jobs run only on main.