Skip to content

ci: gate the npm publish on lint, typecheck, tests and a tag/VERSION match - #32

Merged
VickyXAI merged 1 commit into
mainfrom
ci/gate-publish-on-tests
Aug 19, 2026
Merged

ci: gate the npm publish on lint, typecheck, tests and a tag/VERSION match#32
VickyXAI merged 1 commit into
mainfrom
ci/gate-publish-on-tests

Conversation

@VickyXAI

Copy link
Copy Markdown
Contributor

publish.yml triggers on a GitHub Release and ran nothing but a build before uploading to npm.

That is how 3.13.1 shipped broken: it bumped package.json and src/version.ts but left VERSION on 3.13.0 with no changelog entry. test/unit/version-consistency.test.ts catches both — but it only ran on the push-triggered CI job after the release, by which point npm already had the tree. npm, like PyPI, does not allow replacing a published version.

What this adds

Between pnpm install and pnpm run build:

  1. Release tag vs VERSION — a tag that disagrees with the package version means the wrong tree is being published. The existing "already published" check would stop a duplicate, but only after the release is cut.
  2. pnpm run lint
  3. pnpm run typecheck
  4. pnpm run test --run — which is what covers VERSIONpackage.jsonsrc/version.ts and the changelog entry.

Same shape as the Python SDK's publish.yml, which grew this gate after 1.8.1 died the same way.

Verified

Simulated the tag check against the real tags:

v3.13.1 vs VERSION v3.13.0 => GATE BLOCKS
v3.13.2 vs VERSION v3.13.2 => gate passes

The gate commands run clean on this branch: lint pass, typecheck pass, 265 tests passed / 12 skipped. YAML parses and the steps sit in the intended order (gate → build → pack → publish).

The workflow itself cannot be exercised until the next release — release-triggered workflows only run on a real release. It fails closed, so the failure mode of a mistake here is a blocked publish, not a bad one.

Deliberate omissions

  • Not full CI. This is ci.yml's Node 22 leg; 20 and 24 still run only on push, so a version-incompatible API is caught there rather than at release time.
  • brand-numbers is not a gate. It compares marketing counts in the docs; a stale model number is not a reason to block a bugfix or security release.

…match

publish.yml triggers on a GitHub Release and ran nothing but a build before
uploading to npm. That is how 3.13.1 shipped: it bumped package.json and
src/version.ts but left VERSION on 3.13.0 with no changelog entry, and the
version-consistency suite that catches both never ran until the push-triggered
CI job afterwards — by which point npm had the broken tree and npm, like PyPI,
does not allow replacing a published version.

Adds the same gate the Python SDK's publish workflow has had since 1.8.1 died
the same way: verify the release tag matches VERSION, then lint, typecheck and
the unit suite, all before build/pack/publish. Simulated against the real tags:
v3.13.1 fails the tag check (VERSION said 3.13.0), v3.13.2 passes.

This is ci.yml's 22 leg, not full CI — 20 and 24 still run only on push, so a
version-incompatible API is caught there. brand-numbers is deliberately left
out: it compares marketing counts in the docs, and a stale model number is not
a reason to block a bugfix or security release.
@VickyXAI
VickyXAI merged commit 8c54fab into main Aug 19, 2026
3 checks passed
@VickyXAI
VickyXAI deleted the ci/gate-publish-on-tests branch August 19, 2026 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant