ci: consolidate dev publish into publish.yml#77
Merged
Conversation
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.
Why
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, andpublish.ymlalready owns that slot. The separate file can't authenticate — its OIDC token exchange 404s, pnpm falls back to no auth, and the publish dies withE404 PUT .../bwin. (Confirmed live: the #76 merge ran the job and failed exactly this way.)What
Fold the dev path into
publish.ymlas a second job, selected by trigger event:publish—if: github.event_name == 'workflow_dispatch'. The existing manual stable release:PUBLISHenv gate, tag + release notes,latest. Unchanged.dev-publish—if: pull_request && merged == true. Unattended on each merged PR tomain. Computes an ephemeral<next-patch>-dev-<sha>(e.g.0.4.5-dev-9e70cf0) vianpm version --no-git-tag-version— never written back to the repo — builds, and publishes under thedevdist-tag. No tag, no commit, no re-trigger loop.Deletes the redundant
dev-publish.yml.npm-side requirement (not code)
For the dev job's OIDC to authenticate, the
bwinpackage's npm Trusted Publisher must have its Environment field blank:environment: PUBLISHapproval gate is enforced by GitHub independently, so blanking the npm field does not weaken it.publish.yml.Note
maincurrently has the broken standalonedev-publish.ymlfrom #76; this PR removes it. Merging this supersedes #76's workflow.