Skip to content

ci: gate publish behind the release environment; run tests in CI - #17

Merged
ttpears merged 2 commits into
mainfrom
ci/gate-release-publish
Aug 2, 2026
Merged

ci: gate publish behind the release environment; run tests in CI#17
ttpears merged 2 commits into
mainfrom
ci/gate-release-publish

Conversation

@ttpears

@ttpears ttpears commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Prep for a second contributor working across the MCP repos.

What this changes

Publish is now gated. Today, merging a PR that bumps package.json version makes the tag job in ci.yml push a v* tag, which fires release.yml, which publishes to npm (with provenance), pushes GHCR images, and cuts a GitHub Release — with no human approval anywhere in the chain.

Both jobs in release.yml now target the release environment, which is configured with required reviewers. A tagged build now stages and waits for approval. One approval unblocks both jobs in the run.

CI now runs tests. The build job only ran npm run build, so src/util/semaphore.test.ts has never executed on any push or PR. Added npm run type-check and npm test, matching what mediawiki-mcp CI already does.

Verification

Both commands pass on main as of this branch:

npm run type-check   # exit 0
npm test             # 4 pass, 0 fail

So this adds a gate without changing behavior or requiring any fix.

Not changed

Merging and tagging are still unrestricted — only the publish waits. PR preview images (docker-preview) are unaffected.

Merging a version bump auto-tags via the tag job, and the tag previously fired
release.yml straight through to npm, GHCR, and a GitHub Release with no human
in the loop. Point both release jobs at the `release` environment, which has
required reviewers, so a tagged build stages and waits for approval instead of
shipping itself. One approval unblocks both jobs in the run.

Also run type-check and the test suite in CI. src/util/semaphore.test.ts has
never executed on any push or PR because the build job only ran `npm run build`.
Both pass on main today, so this adds a gate without changing any behavior.
Enabling `npm test` in CI surfaced a latent problem: the script passes a glob
to `node --test`, and glob support in the test runner only landed in Node 21.
The build job ran Node 20, which treated the pattern as a literal path and
failed with "Could not find .../src/**/*.test.ts".

release.yml already pins Node 22. `engines` stays >=18 — installing the package
runs `prepare` (tsc build), never the test suite.
@ttpears
ttpears merged commit 6e12dde into main Aug 2, 2026
3 checks passed
@ttpears
ttpears deleted the ci/gate-release-publish branch August 2, 2026 23:29
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