Skip to content

chore: add authorized npm publication workflow - #336

Merged
electrohyun merged 2 commits into
mainfrom
chore/npm-publication-workflow
Aug 14, 2026
Merged

electrohyun merged 2 commits into
mainfrom
chore/npm-publication-workflow

Conversation

@electrohyun

Copy link
Copy Markdown
Owner

Summary

This PR adds the repository-owned publication path that follows the initial synchronized smocket and smocket-client release.

  • Add a manual Publish release workflow that accepts one exact synchronized version and refuses any repository or ref other than electrohyun/smocket on main.
  • Build one two-package release candidate after the quality, dual-target, conformance, public-surface, supported Socket.IO, package-consumer, and Chromium gates pass.
  • Preserve the candidate as one immutable artifact set, then revalidate both tarball sizes, SHA-256 digests, package identities, synchronized versions, and the client's exact smocket peer before either registry write.
  • Publish the manifest-owned smocket tarball first and the manifest-owned smocket-client tarball second in separate jobs.
  • Exercise the exact published pair outside the checkout and keep publication or registry verification failures unsuccessful.

Publication authority

The workflow has only a workflow_dispatch trigger, so pull requests and forks do not enter a registry mutation path. An initial authorization job also requires the canonical repository and main ref.

Only the two publish jobs receive id-token: write. They run on GitHub-hosted runners behind the npm environment and otherwise retain read-only repository permission. Publication uses npm trusted publishing with a short-lived GitHub OIDC identity; no npm token is added to the repository or workflow, and this change does not alter npm 2FA, token, or package publishing-access settings.

Candidate and publication chain

The preflight job creates the candidate once and uploads its manifest and two tarballs under the workflow run ID. The root and client jobs independently download that same artifact and call a small publication helper that reloads the manifest before invoking npm. The helper accepts only an exact version, an HTTPS registry without embedded credentials, and one of the two released package names.

Keeping the two registry writes in separate jobs preserves the required root-before-client order and allows a failed client job to be resumed without intentionally rerunning a successful root publish. Re-uploading the run's artifact set is not enabled, so a resumed downstream job continues from the original candidate.

Failure and certification behavior

The final job waits for and installs both exact registry versions, checks their resolved identities and exact peer relationship, and exercises the shared registry behavior through the existing clean-adoption fixtures. Its successful conclusion is the certification signal. GitHub tags and Releases neither trigger nor replace it.

The publication documentation now records the authority boundary, required external trusted-publisher and environment configuration, ordered release chain, and the existing deprecation or fix-forward runbook. A partial publication or failed final check remains red and follows that runbook.

Closes #320
Related to #284

@github-actions github-actions Bot added chore Tooling, CI, and dependencies 📏 l Pull request changes 200–999 lines labels Aug 14, 2026
@electrohyun
electrohyun merged commit 0038961 into main Aug 14, 2026
15 checks passed
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@electrohyun, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 9 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 1604c94d-3872-40d3-9f15-7610fa6e860e

📥 Commits

Reviewing files that changed from the base of the PR and between 2cc0ac8 and 1a689d7.

📒 Files selected for processing (7)
  • .github/workflows/release.yml
  • docs/README.md
  • docs/npm-publication.md
  • docs/release-candidates.md
  • docs/release-remediation.md
  • scripts/publish-release-candidate.mjs
  • scripts/publish-release-candidate.test.ts

Comment @coderabbitai help to get the list of available commands.

@electrohyun
electrohyun deleted the chore/npm-publication-workflow branch August 14, 2026 06:30
@electrohyun electrohyun self-assigned this Aug 27, 2026
@github-project-automation github-project-automation Bot moved this to Done in smocket Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Tooling, CI, and dependencies 📏 l Pull request changes 200–999 lines

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

chore: add npm publication workflow after the initial client release

1 participant