From 475177ad13cc1ad83603c01e384cbc63c379c8c5 Mon Sep 17 00:00:00 2001 From: Shrey Pandya Date: Thu, 13 Aug 2026 08:22:00 +0000 Subject: [PATCH 1/2] chore(cli): prepare browse 0.9.7 from v3 --- .changeset/warm-functions-parity.md | 5 -- .github/workflows/release.yml | 110 ++++++++++++++++++++++++++++ packages/cli/CHANGELOG.md | 6 ++ packages/cli/package.json | 2 +- 4 files changed, 117 insertions(+), 6 deletions(-) delete mode 100644 .changeset/warm-functions-parity.md diff --git a/.changeset/warm-functions-parity.md b/.changeset/warm-functions-parity.md deleted file mode 100644 index a29162f9d..000000000 --- a/.changeset/warm-functions-parity.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"browse": patch ---- - -Align `browse functions` with the Browserbase Functions SDK by supporting optional project overrides, matching local invocation context and error payloads, and accepting the SDK's `--api-url` option. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 368f14732..4b9c087a1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - v3-cli permissions: contents: write @@ -14,8 +15,117 @@ permissions: concurrency: ${{ github.workflow }}-${{ github.ref }} jobs: + release-browse: + name: Release Browse CLI + if: github.ref == 'refs/heads/v3-cli' + runs-on: ubuntu-latest + timeout-minutes: 30 + permissions: + contents: write + id-token: write + steps: + - name: Checkout Repo + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + fetch-depth: 0 + + - uses: ./.github/actions/setup-node-pnpm-turbo + with: + use-prebuilt-artifacts: "false" + + - name: Configure npm registry for Trusted Publishing + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version: 20.x + registry-url: "https://registry.npmjs.org" + + - name: Update npm for Trusted Publishing + run: npm install -g npm@11.18.0 + + - name: Check release status + id: release + shell: bash + run: | + package_name="$(node -p "require('./packages/cli/package.json').name")" + package_version="$(node -p "require('./packages/cli/package.json').version")" + test "$package_name" = "browse" + + published_versions="$(npm view "$package_name" versions --json)" + if jq -e --arg version "$package_version" 'index($version) != null' \ + <<<"$published_versions" >/dev/null; then + echo "browse@$package_version is already published; nothing to do." + echo "should_publish=false" >> "$GITHUB_OUTPUT" + else + echo "Publishing browse@$package_version from $GITHUB_SHA." + echo "should_publish=true" >> "$GITHUB_OUTPUT" + fi + + echo "version=$package_version" >> "$GITHUB_OUTPUT" + + - name: Lint Browse + if: steps.release.outputs.should_publish == 'true' + run: pnpm --filter browse lint + + - name: Test Browse + if: steps.release.outputs.should_publish == 'true' + run: pnpm --filter browse test + + - name: Pack Browse + if: steps.release.outputs.should_publish == 'true' + id: pack + shell: bash + env: + VERSION: ${{ steps.release.outputs.version }} + run: | + pack_dir="$RUNNER_TEMP/browse-pack" + mkdir -p "$pack_dir" + pnpm --dir packages/cli pack --pack-destination "$pack_dir" + + tarball="$pack_dir/browse-$VERSION.tgz" + test -f "$tarball" + tar -xOf "$tarball" package/package.json | \ + jq -e --arg version "$VERSION" '.name == "browse" and .version == $version' >/dev/null + echo "tarball=$tarball" >> "$GITHUB_OUTPUT" + + - name: Smoke-test packed CLI + if: steps.release.outputs.should_publish == 'true' + shell: bash + env: + TARBALL: ${{ steps.pack.outputs.tarball }} + VERSION: ${{ steps.release.outputs.version }} + run: | + smoke_dir="$RUNNER_TEMP/browse-smoke" + mkdir -p "$smoke_dir" + npm install --prefix "$smoke_dir" "$TARBALL" + "$smoke_dir/node_modules/.bin/browse" --version | grep -F "$VERSION" + "$smoke_dir/node_modules/.bin/browse" functions --help | grep -F "functions publish" + + - name: Publish Browse + if: steps.release.outputs.should_publish == 'true' + env: + TARBALL: ${{ steps.pack.outputs.tarball }} + run: npm publish "$TARBALL" --access public --provenance + + - name: Tag Browse release + if: steps.release.outputs.should_publish == 'true' + shell: bash + env: + VERSION: ${{ steps.release.outputs.version }} + run: | + tag="browse@$VERSION" + if git rev-parse -q --verify "refs/tags/$tag" >/dev/null; then + echo "Tag $tag already exists." + exit 0 + fi + + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git tag "$tag" "$GITHUB_SHA" + git push origin "refs/tags/$tag" + release: name: Release + if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest steps: - name: Checkout Repo diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index fab14ae30..184e73a3a 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,11 @@ # browse +## 0.9.7 + +### Patch Changes + +- [#2704](https://github.com/browserbase/stagehand/pull/2704) - Repair `browse functions` parity with the Browserbase Functions SDK: infer the project from the API key by default, preserve optional project overrides, and align scaffolding, local invocation, runtime errors, archive limits, and the `--api-url` option. + ## 0.9.6 ### Patch Changes diff --git a/packages/cli/package.json b/packages/cli/package.json index d8abad363..0ec83398d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "browse", - "version": "0.9.6", + "version": "0.9.7", "description": "Unified Browserbase CLI for browser automation and cloud APIs.", "type": "module", "private": false, From 7365a20d52955c10d72606f2e6ddd74791609d13 Mon Sep 17 00:00:00 2001 From: Shrey Pandya Date: Thu, 13 Aug 2026 16:11:03 +0000 Subject: [PATCH 2/2] fix: address Cubic release review --- .github/workflows/release.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4b9c087a1..28021feab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -70,6 +70,10 @@ jobs: if: steps.release.outputs.should_publish == 'true' run: pnpm --filter browse test + - name: Build Browse for packaging + if: steps.release.outputs.should_publish == 'true' + run: pnpm --filter browse build + - name: Pack Browse if: steps.release.outputs.should_publish == 'true' id: pack @@ -107,14 +111,19 @@ jobs: run: npm publish "$TARBALL" --access public --provenance - name: Tag Browse release - if: steps.release.outputs.should_publish == 'true' + if: ${{ !cancelled() && steps.release.outputs.version != '' }} shell: bash env: VERSION: ${{ steps.release.outputs.version }} run: | tag="browse@$VERSION" - if git rev-parse -q --verify "refs/tags/$tag" >/dev/null; then - echo "Tag $tag already exists." + if ! npm view "browse@$VERSION" version >/dev/null 2>&1; then + echo "browse@$VERSION is not published; skipping tag." + exit 0 + fi + + if git ls-remote --exit-code --tags origin "refs/tags/$tag" >/dev/null 2>&1; then + echo "Remote tag $tag already exists." exit 0 fi