From a734a667989e2eb8368851d644836d3ae5279bce Mon Sep 17 00:00:00 2001 From: Azam Abdulkadir Date: Fri, 25 Sep 2026 12:02:40 -0700 Subject: [PATCH 1/2] Add manual npm publishing workflow --- .github/workflows/publish.yml | 66 +++++++++++++++++++++++++++++++++++ package.json | 4 +++ 2 files changed, 70 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..665b635 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,66 @@ +name: Publish to npm + +on: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: npm-publish + cancel-in-progress: false + +jobs: + publish: + # Only the upstream repository's main branch may publish. + if: >- + github.repository == 'browserbase/sdk-functions-node' && + github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + # Configure required BB reviewers and a main-only deployment rule in GitHub. + environment: npm-publish + permissions: + contents: read + id-token: write + + steps: + - name: Checkout release commit + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "24.x" + registry-url: https://registry.npmjs.org + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 10.12.1 + + # npm trusted publishing requires npm >= 11.5.1. + - name: Setup npm for trusted publishing + run: npm install --global npm@11 + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Lint and typecheck + run: pnpm run lint + + - name: Run unit tests + run: pnpm run test + + - name: Build SDK + run: pnpm run build + + - name: Run integration tests + run: pnpm run test:integration + + - name: Inspect package contents + run: npm publish --dry-run + + - name: Publish to npm + run: npm publish --access public --tag latest diff --git a/package.json b/package.json index ff4c0de..0deeb45 100644 --- a/package.json +++ b/package.json @@ -67,5 +67,9 @@ "dotenv": "^17.2.3", "tsx": "^4.20.5", "zod": "^4.1.5" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/browserbase/sdk-functions-node.git" } } From 174bcce00696933a0e89ba546627232a04a38d03 Mon Sep 17 00:00:00 2001 From: Azam Abdulkadir Date: Fri, 25 Sep 2026 12:04:35 -0700 Subject: [PATCH 2/2] Remove publishing workflow comments --- .github/workflows/publish.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 665b635..e42d666 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,12 +12,10 @@ concurrency: jobs: publish: - # Only the upstream repository's main branch may publish. if: >- github.repository == 'browserbase/sdk-functions-node' && github.ref == 'refs/heads/main' runs-on: ubuntu-latest - # Configure required BB reviewers and a main-only deployment rule in GitHub. environment: npm-publish permissions: contents: read @@ -40,7 +38,6 @@ jobs: with: version: 10.12.1 - # npm trusted publishing requires npm >= 11.5.1. - name: Setup npm for trusted publishing run: npm install --global npm@11