Skip to content

ci: publish from a tag-driven workflow with npm trusted publishing - #200

Merged
justin-schroeder merged 1 commit into
release/0.6.0from
ci/publish-workflow
Jun 11, 2026
Merged

justin-schroeder merged 1 commit into
release/0.6.0from
ci/publish-workflow

Conversation

@justin-schroeder

Copy link
Copy Markdown
Member

Moves publishing from local pnpm publish to a tag-driven GitHub workflow, modeled on how tempo and the formkit monorepo publish.

How releasing works now

Push a git tag and the workflow does the rest:

Tag npm version dist-tag
v0.6.0 0.6.0 latest — only allowed from main
v0.6.0-next.abc1234 0.6.0-next.abc1234 next
v0.6.0-dev.abc1234 0.6.0-dev.abc1234 dev

The prerelease suffix is the short commit hash.

Pipeline

  1. Tests first: publish.yml calls ci.yml (now workflow_call-able) — the full 4-shard Playwright matrix must pass before anything publishes.
  2. Version is written into package.json from the tag, built, validated with publint, and published from dist/.
  3. npm trusted publishing (OIDC) — id-token: write + npm@latest, no NPM_TOKEN anywhere.
  4. changelogithub generates GitHub release notes for latest releases only.

Housekeeping

  • release.yml is removed (superseded — the npm trusted publisher needs to point at publish.yml when configured).
  • ci.yml no longer fires directly on tag pushes (publish.yml invokes it), so a release runs the matrix exactly once.

Publishing is now a GitHub workflow instead of a local pnpm publish:

- Pushing a v* tag triggers publish.yml. The version comes from the tag
  (v0.6.0 -> 0.6.0, v0.6.0-dev.abc1234 -> 0.6.0-dev.abc1234) and the
  npm dist-tag is inferred from it: plain versions publish as latest
  (allowed only from main), -next.* as next, -dev.* as dev, with the
  short commit hash as the prerelease suffix.
- The full Playwright matrix runs first (ci.yml is now callable and
  gates the publish job).
- npm trusted publishing via OIDC: id-token permission + npm@latest,
  no tokens anywhere.
- Build is validated with publint and published from dist/.
- changelogithub generates GitHub release notes for latest releases.

Replaces release.yml; ci.yml no longer fires directly on tag pushes
since publish.yml invokes it.
@vercel

vercel Bot commented Jun 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
drag-and-drop-docs Ready Ready Preview Jun 11, 2026 7:58pm

Request Review

@justin-schroeder justin-schroeder left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review notes: dist-tag inference regex matches the formkit monorepo's exactly (a version like 1.0.0-devtools.1 would publish as latest — same accepted behavior there; the canonical prerelease channels are -next./-dev.). The latest-branch guard uses 'git branch -r --contains HEAD' with fetch-depth 0, same as the hardened release.yml had. publish runs from dist/ where build.ts writes the public package.json (private stripped, exports rewritten) — verified earlier in #180 that the built manifest is correct. Node pinned to the same verified-good 24.15.0 as ci.yml.

@justin-schroeder
justin-schroeder merged commit 6530a01 into release/0.6.0 Jun 11, 2026
4 of 5 checks passed

This branch was successfully deployed

1 active deployment
Preview — b40d1ebe Deployed Jun 11, 2026 by vercel[bot]
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