Skip to content

ci: token-less npm publishing via OIDC Trusted Publishing#109

Merged
ethanj merged 1 commit into
mainfrom
ci/npm-trusted-publishing
Jun 16, 2026
Merged

ci: token-less npm publishing via OIDC Trusted Publishing#109
ethanj merged 1 commit into
mainfrom
ci/npm-trusted-publishing

Conversation

@ethanj

@ethanj ethanj commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

What

Adds .github/workflows/publish.yml — token-less npm publishing for llm-wiki-compiler via OIDC Trusted Publishing, modeled on the AtomicMemory publish pipeline. No NPM_TOKEN.

How it works

  • repository_dispatch (type llmwiki-package-release) is the primary trigger; workflow_dispatch is a manual fallback. Both take an explicit public_sha + version + publish payload.
  • Checks out the exact public_sha (never branch HEAD), verifies package.json matches version, refuses to republish an existing version, runs release:check-docs:current + build + test + npm pack --dry-run, then npm publish --access public with id-token: write (provenance attached automatically). A final job asserts npm view … gitHead === public_sha.
  • No required reviewers — the control point is the dispatch payload + guards, so a release can be triggered entirely from a script.

One-time setup before first use (account-level, not in this repo)

  1. Configure the npm Trusted Publisher for llm-wiki-compiler: repo atomicstrata/llm-wiki-compiler, workflow publish.yml, environment npm-release.
  2. The npm-release GitHub Environment is created on first reference; leave it without required reviewers (auto-publish, per design).

Triggering a release (after setup)

echo '{"event_type":"llmwiki-package-release","client_payload":{"public_sha":"<40-char-sha>","version":"<x.y.z>","publish":true}}' \\
  | gh api repos/atomicstrata/llm-wiki-compiler/dispatches --input -

This same mechanism can publish the already-tagged 0.11.0 (public_sha=7107fd7…, version=0.11.0) once the Trusted Publisher is configured.

Adds a repository_dispatch + workflow_dispatch publish workflow modeled on the AtomicMemory pipeline. It checks out an explicit public_sha, verifies package.json matches the requested version, refuses to republish an existing version, builds/tests, then publishes with id-token write and no NPM_TOKEN, and verifies the registry gitHead matches the released SHA.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ethanj ethanj merged commit 4269f9c into main Jun 16, 2026
3 checks passed
@ethanj ethanj deleted the ci/npm-trusted-publishing branch June 16, 2026 09:26
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