Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/warm-functions-parity.md

This file was deleted.

119 changes: 119 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- v3-cli

permissions:
contents: write
Expand All @@ -14,8 +15,126 @@ 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
Comment thread
shrey150 marked this conversation as resolved.
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: 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
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"
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.

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
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
if: ${{ !cancelled() && steps.release.outputs.version != '' }}
shell: bash
env:
VERSION: ${{ steps.release.outputs.version }}
run: |
tag="browse@$VERSION"
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

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
Expand Down
6 changes: 6 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Loading