ci: auto-publish dev release to npm on merged PR#76
Merged
Conversation
Adds dev-publish.yml: on every PR merged to main, compute an ephemeral <next-patch>-dev-<shortsha> version, build, and publish to npm under the dev dist-tag via OIDC. The version is never written back to the repo (npm version --no-git-tag-version), so there is no bump commit and no re-trigger loop. Runs unattended (no PUBLISH environment gate); latest is never touched.
ohxyz
added a commit
that referenced
this pull request
Jun 17, 2026
PR #76 shipped dev publishing as a separate workflow file (dev-publish.yml), but npm trusted publishing (OIDC) allows only one workflow filename per package — publish.yml already owns that slot. The separate file's OIDC token exchange 404s, pnpm falls back to no auth, and the publish fails with E404. Fold the dev path into publish.yml as a second job, selected by event: - workflow_dispatch → stable 'publish' job (PUBLISH env gate, latest) - merged PR to main → 'dev-publish' job (unattended, dev dist-tag), publishing an ephemeral <next-patch>-dev-<sha> never written back. Delete the now-redundant dev-publish.yml. For the dev job's OIDC to work, the npm trusted-publisher's environment field must be blank so it matches the env-less job; the stable job keeps its GitHub-side PUBLISH approval gate regardless.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
.github/workflows/dev-publish.yml: on every PR merged intomain, automatically publish a dev build to npm under thedevdist-tag.How
pull_request: closedonmain, guarded byif: github.event.pull_request.merged == true(ignores closed-without-merge).package.json, auto-increments the patch field, appends-dev-<shortsha>→ e.g.0.4.5-dev-9e70cf0. Applied withnpm version --no-git-tag-version, so it edits only the runner's copy — no commit, no tag, nothing pushed back to main. This is what avoids any version-bump-PR / re-trigger loop.pnpm publish --no-git-checks --access public --tag devvia OIDC. Runs unattended (noPUBLISHenvironment gate, by design).latestis never touched.Notes
publish.ymlstep structure; that manual stable-release workflow is unchanged.package.jsonis bumped on main — expected.PUBLISHenvironment. If the npm trusted-publisher config is scoped to that environment, it must be widened to cover this workflow.