Repository navigation
[chore]: disable proxies in CI (#3143) #1271
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| id-token: write | |
| pull-requests: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| release-typescript: | |
| name: Release TypeScript SDK | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 | |
| with: | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| with: | |
| version: "11.11.0" | |
| run_install: false | |
| - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 | |
| with: | |
| node-version: "24" | |
| cache: pnpm | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Install npm | |
| run: npm install --global npm@11.16.0 | |
| - name: Set up Python | |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 | |
| with: | |
| python-version-file: packages/sdk-python/.python-version | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| with: | |
| version: "0.11.29" | |
| working-directory: packages/sdk-python | |
| enable-cache: true | |
| cache-dependency-glob: packages/sdk-python/uv.lock | |
| - uses: extractions/setup-just@f8a3cce218d9f83db3a2ecd90e41ac3de6cdfd9b # v3.1.0 | |
| - run: just install | |
| # Generate and format checked-in artifacts before validating the worktree. | |
| - run: just build | |
| - run: just check | |
| - name: Scope the Changesets action to SDK changes | |
| id: sdk-changesets | |
| run: pnpm exec tsx scripts/release/sdk-action-changesets.ts hide >> "$GITHUB_OUTPUT" | |
| - name: Create release pull request or publish TypeScript | |
| id: changesets | |
| uses: changesets/action@a45c4d594aa4e2c509dc14a9f2b3b67ba3780d0d # v1.9.0 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| version: just _version | |
| publish: just _publish-typescript | |
| title: Release Stagehand packages | |
| commit: release Stagehand packages | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| CHANGESETS_ACTION_PRESERVE_CHANGELOGS: "true" | |
| - name: Restore pending Browse changesets | |
| if: always() && steps.sdk-changesets.outputs.directory != '' | |
| env: | |
| CHANGESET_BACKUP: ${{ steps.sdk-changesets.outputs.directory }} | |
| run: pnpm exec tsx scripts/release/sdk-action-changesets.ts restore "$CHANGESET_BACKUP" | |
| release-cli: | |
| name: Release Browse CLI | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 | |
| with: | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| with: | |
| version: "11.11.0" | |
| run_install: false | |
| - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 | |
| with: | |
| node-version: "24" | |
| cache: pnpm | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Install npm | |
| run: npm install --global npm@11.16.0 | |
| - run: pnpm install --frozen-lockfile | |
| - name: Check Browse changesets | |
| id: status | |
| run: pnpm exec tsx scripts/release/scoped-release.ts status cli >> "$GITHUB_OUTPUT" | |
| - name: Prepare Browse release PR | |
| if: steps.status.outputs.has-changesets == 'true' | |
| run: pnpm exec tsx scripts/release/prepare-cli-release.ts | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Wait for published SDK dependencies | |
| if: steps.status.outputs.should-publish == 'true' | |
| run: pnpm exec tsx scripts/release/scoped-release.ts wait-dependencies cli | |
| - name: Build and smoke-test Browse against the published SDK | |
| if: steps.status.outputs.should-publish == 'true' | |
| run: | | |
| pnpm exec tsx scripts/release/smoke-cli-package.ts | |
| pnpm --filter browse test:cli | |
| - name: Publish Browse | |
| if: steps.status.outputs.should-publish == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| pnpm exec tsx scripts/release/scoped-release.ts publish cli | |
| - name: Push Browse release tag | |
| if: always() && !cancelled() && steps.status.outcome == 'success' && steps.status.outputs.has-changesets == 'false' | |
| run: pnpm exec tsx scripts/release/push-cli-release-tag.ts | |
| publish-cli-alpha: | |
| name: Publish Browse alpha | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 | |
| with: | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| with: | |
| version: "11.11.0" | |
| run_install: false | |
| - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 | |
| with: | |
| node-version: "24" | |
| cache: pnpm | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Install npm | |
| run: npm install --global npm@11.16.0 | |
| - run: pnpm install --frozen-lockfile | |
| # Independent of stable jobs: failed tag recovery must not block alphas. | |
| # A push may contain several commits, so compare against its before SHA. | |
| - name: Prepare Browse alpha | |
| id: alpha | |
| env: | |
| CLI_ALPHA_BASE: ${{ github.event.before }} | |
| run: pnpm exec tsx scripts/release/cli-alpha.ts >> "$GITHUB_OUTPUT" | |
| - name: Wait for published SDK dependencies | |
| if: steps.alpha.outputs.should-publish == 'true' | |
| run: pnpm exec tsx scripts/release/scoped-release.ts wait-dependencies cli | |
| - name: Build and smoke-test Browse alpha against the published SDK | |
| if: steps.alpha.outputs.should-publish == 'true' | |
| run: | | |
| pnpm exec tsx scripts/release/smoke-cli-package.ts | |
| pnpm --filter browse test:cli | |
| - name: Publish Browse alpha | |
| if: steps.alpha.outputs.should-publish == 'true' | |
| run: pnpm exec tsx scripts/release/scoped-release.ts publish cli --alpha | |
| publish-typescript-alpha: | |
| name: Publish TypeScript SDK alpha | |
| needs: release-typescript | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 | |
| with: | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| with: | |
| version: "11.11.0" | |
| run_install: false | |
| - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 | |
| with: | |
| node-version: "24" | |
| cache: pnpm | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Install npm | |
| run: npm install --global npm@11.16.0 | |
| - uses: extractions/setup-just@f8a3cce218d9f83db3a2ecd90e41ac3de6cdfd9b # v3.1.0 | |
| - run: pnpm install --frozen-lockfile | |
| # The TypeScript SDK bundles the extension, which in turn needs the protocol schema. | |
| - run: pnpm exec turbo run build --filter=@browserbasehq/stagehand | |
| # Versions SDK packages with a pending changeset as `<next>-alpha-<sha>` and | |
| # publishes the public ones under the `alpha` dist-tag. The working tree is | |
| # discarded afterwards, so nothing is committed. No-op when there are no | |
| # unreleased changesets (e.g. the push that just cut a stable release). | |
| - name: Publish alpha | |
| run: just _publish-typescript-alpha | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| python-release-status: | |
| name: Check Python release status | |
| needs: release-typescript | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: read | |
| outputs: | |
| should-publish: ${{ steps.status.outputs.should-publish }} | |
| steps: | |
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 | |
| - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| with: | |
| version: "11.11.0" | |
| run_install: false | |
| - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 | |
| with: | |
| node-version: "24" | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - name: Check PyPI | |
| id: status | |
| run: echo "should-publish=$(pnpm exec tsx scripts/release/python-publish-status.ts)" >> "$GITHUB_OUTPUT" | |
| publish-python: | |
| name: Release Python SDK | |
| needs: python-release-status | |
| if: github.ref == 'refs/heads/main' && needs.python-release-status.outputs.should-publish == 'true' | |
| uses: ./.github/workflows/publish-python.yml | |
| secrets: inherit | |
| python-alpha-status: | |
| name: Check Python alpha status | |
| needs: release-typescript | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: read | |
| outputs: | |
| should-publish: ${{ steps.status.outputs.should-publish }} | |
| version: ${{ steps.status.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 | |
| with: | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| with: | |
| version: "11.11.0" | |
| run_install: false | |
| - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 | |
| with: | |
| node-version: "24" | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| # Only packages with pending changesets receive a snapshot version, so this | |
| # tells us whether the Python SDK has anything unreleased to publish. | |
| - run: pnpm exec tsx scripts/release/scoped-release.ts version sdk --snapshot | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Check alpha version | |
| id: status | |
| run: node scripts/release/python-alpha-version.ts --check >> "$GITHUB_OUTPUT" | |
| publish-python-alpha: | |
| name: Release Python SDK alpha | |
| needs: python-alpha-status | |
| if: github.ref == 'refs/heads/main' && needs.python-alpha-status.outputs.should-publish == 'true' | |
| uses: ./.github/workflows/publish-python.yml | |
| with: | |
| alpha: true | |
| secrets: inherit | |
| publish-go: | |
| name: Release Go SDK | |
| needs: release-typescript | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 | |
| with: | |
| node-version: "24" | |
| - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| with: | |
| version: "11.11.0" | |
| run_install: false | |
| - run: pnpm install --frozen-lockfile | |
| - name: Check Go release status | |
| id: status | |
| run: pnpm exec tsx scripts/release/go-publish-status.ts >> "$GITHUB_OUTPUT" | |
| - name: Tag Go release | |
| if: steps.status.outputs.should-tag == 'true' | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| TAG: ${{ steps.status.outputs.tag }} | |
| run: | | |
| gh api --method POST "repos/$GITHUB_REPOSITORY/git/refs" \ | |
| -f ref="refs/tags/$TAG" \ | |
| -f sha="$GITHUB_SHA" |