Skip to content

Commit 9f16e68

Browse files
authored
chore(publish): changesets + release.yml + contract tests for benchsdk (#227)
* chore: publish plumbing for benchsdk (changesets, release workflow, contract test) - Add @changesets/cli devDep + .changeset/config.json (public, baseBranch master) - Add .changeset/initial-publication.md (patch release for benchsdk) - Add .github/workflows/release.yml (OIDC trusted publishing, pnpm, npm@11, --provenance) - Add public-api.contract.test.ts (100 vitest assertions pinning SDK API surface) - Export PlanWorkersInput from benchsdk/src/index.ts barrel * fix: address Devin review (P1 provenance flag, P2 CI workflow, nits) P1: Replace 'changeset publish --provenance' with NPM_CONFIG_PROVENANCE env var (@changesets/cli 2.31.1 rejects unknown --provenance flag) P2: Update NPM_TOKEN TODO with full 3-step OIDC migration sequence P2: Add ci.yml workflow (build + typecheck + test on PRs) P2: Add test step to release.yml before changesets publish Nit: Remove unnecessary issues:write and repository-projects:write permissions Nit: Update changeset config $schema to 3.1.4 (matches lockfile) Nit: VAL-SDK-090 asserts against built dist/index.d.ts instead of regex-parsing source Nit: Remove VAL-SDK-094 (pinned describe.skip — wrong invariant to lock) Nit: VAL-SDK-052/085 use fake timers to eliminate flake risk * fix: untrack dist/burst-100k.cjs and add pretest script - git rm --cached dist/burst-100k.cjs (was committed before dist/ gitignore rule) - Add 'pretest: tsup' to packages/benchsdk/package.json so contract tests that read dist/index.d.ts work on fresh clones without manual build
1 parent 984f9e9 commit 9f16e68

11 files changed

Lines changed: 2373 additions & 258288 deletions

File tree

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.4/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "master",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.changeset/initial-publication.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"benchsdk": patch
3+
---
4+
5+
Initial publication of the `benchsdk` npm package, consolidated out of the `computesdk` monorepo (formerly `@computesdk/bench`). Same public API surface (`createBenchmarkClient`, `defineStep`/`defineTask`/`defineWorker`/`defineBench`, `BenchmarkReporter`, `createSystemMetricsCollector`); only the source repository and npm publish name changed.

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
ci:
15+
name: CI
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Install pnpm
22+
uses: pnpm/action-setup@v4
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: '24'
28+
cache: 'pnpm'
29+
30+
- name: Install dependencies
31+
run: pnpm install --ignore-scripts
32+
33+
- name: Build packages
34+
# The root typecheck consumes the built dist output, so build benchsdk
35+
# before running typecheck.
36+
run: pnpm --filter benchsdk run build
37+
38+
- name: Typecheck
39+
run: pnpm typecheck
40+
41+
- name: Test
42+
run: pnpm --filter benchsdk run test

.github/workflows/release.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: ["master"]
6+
7+
concurrency: ${{ github.workflow }}-${{ github.ref }}
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
id-token: write # Required for npm OIDC trusted publishing
13+
14+
jobs:
15+
release:
16+
name: Release
17+
# Must use a GitHub-hosted runner — npm OIDC trusted publishing does not
18+
# support self-hosted runners at this time.
19+
# https://docs.npmjs.com/trusted-publishers/
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
token: ${{ secrets.RELEASE_TOKEN || secrets.GITHUB_TOKEN }}
27+
28+
- name: Install pnpm
29+
uses: pnpm/action-setup@v4
30+
31+
- name: Setup Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: '24'
35+
cache: 'pnpm'
36+
37+
- name: Update npm
38+
# npm 11.5.1+ is required for OIDC trusted publishing support.
39+
# Pin to 11.x: npm 12.0.0 ships a broken bundle missing the `sigstore`
40+
# module in libnpmpublish, which breaks `publish --provenance` with
41+
# "Cannot find module 'sigstore'".
42+
run: npm install -g npm@11
43+
44+
- name: Install dependencies
45+
run: pnpm install --ignore-scripts
46+
47+
- name: Build packages
48+
run: pnpm --filter benchsdk run build
49+
50+
- name: Test
51+
run: pnpm --filter benchsdk run test
52+
53+
- name: Create Release Pull Request or Publish to npm
54+
id: changesets
55+
uses: changesets/action@v1
56+
with:
57+
# Provenance (signed attestations linking each package to this
58+
# workflow run) is configured via the NPM_CONFIG_PROVENANCE env var
59+
# below rather than a `--provenance` CLI flag, which @changesets/cli
60+
# does not support.
61+
publish: pnpm changeset publish
62+
title: "Version Packages"
63+
commit: "Version Packages"
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.CHANGESET_TOKEN || secrets.GITHUB_TOKEN }}
66+
# Sequence: (1) publish once with NPM_TOKEN, (2) configure the trusted
67+
# publisher for benchsdk on npmjs.com, (3) remove NPM_TOKEN from this
68+
# workflow in a follow-up. Trusted publishers require an existing
69+
# package on the registry, so OIDC cannot be used for the initial
70+
# publication.
71+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
72+
NPM_CONFIG_PROVENANCE: true

0 commit comments

Comments
 (0)