ci: combine release workflows into a single file for trusted publishing#2345
Merged
Conversation
npm Trusted Publishing can only be configured against a single workflow file, so merge `prerelease-canary.yml` into `release.yml` as two branch-gated jobs: - `stable` runs on `main` and publishes the `latest` dist-tag - `canary` runs on `canary` and publishes the `canary` dist-tag Only the job matching the pushed branch runs (`if: github.ref == …`). The canary job now publishes via Trusted Publishing as well, dropping the `NPM_TOKEN` / `NODE_AUTH_TOKEN` to match the stable job. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
npm Trusted Publishing is configured against a single workflow file, but releases were split across two:
release.yml(stable) andprerelease-canary.yml(canary). This merges them into onerelease.ymlso both stable and canary can publish via Trusted Publishing.What
release.ymlnow triggers on pushes to bothmainandcanary, with two branch-gated jobs — only the one matching the pushed branch runs:stablemainpnpm run publish→latestcanarycanarylerna publish 0.0.0-canary-<sha> --dist-tag canaryif: github.ref == 'refs/heads/main'/'refs/heads/canary', so a push only ever runs one of them.fix:/feat:/feat!:).id-token: write,npm install -g npm@latest), droppingNODE_AUTH_TOKEN/NPM_TOKENto match the stable job.prerelease-canary.ymlis removed.Trusted Publishing for the packages should now point at
release.yml.