Repository navigation
fix(ci): publish to npm the way the other Flowcore libraries do - #97
Merged
Merged
Conversation
The publish has been failing since 0.22.1. 0.22.2, 0.22.3 and 0.23.0 are all tagged on GitHub and absent from npm. Two causes, both from drifting away from the shared pipeline: The job used `actions/setup-node`, which does not inject an npm token. It falls back to NODE_AUTH_TOKEN — a classic token, and npm revoked those in March 2025. `npm publish` then failed with `E404 Not Found - PUT` on a package that plainly exists, because npm answers 404 rather than 403 to avoid leaking existence. `useblacksmith/setup-node` injects a transient token over OIDC instead, which is what @flowcore/pathways and @flowcore/sdk already use. The job also installed a floating `npm@latest` on a pinned node, which broke when npm 12 raised its engine requirement. The shared pipeline pins npm 11. Also adds the test gate the other libraries run before publishing, and a workflow_dispatch trigger so a failed publish can be re-run against the fixed file rather than replaying the broken one from the tag. Refs: Usable e19e9f79-9122-4670-a0ae-63f4316d5592, d474dd0d-470d-49cc-9bab-db3002e06e5a Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Summary
The npm publish has been broken since 0.22.1. 0.22.2, 0.22.3 and 0.23.0 are all tagged on GitHub and absent from npm.
Two causes, both from this repo drifting away from the shared library pipeline.
1. Wrong setup-node action, so no npm auth
The job used
actions/setup-node, which does not inject an npm token. It falls back toNODE_AUTH_TOKEN— a classic token, and npm revoked those in March 2025.The 404 is misleading: the package plainly exists. npm answers 404 rather than 403 on an unauthorized publish so it does not leak package existence.
useblacksmith/setup-node@v5injects a transient token over OIDC instead. That is what@flowcore/pathwaysand@flowcore/sdkalready use.2. A floating npm on a pinned node
The job ran
npm install -g npm@lateston node 20. npm 12 raised its engine requirement to^22.22.2 || ^24.15.0 || >=26, so the step died withEBADENGINEbeforenpm publishwas ever reached. The shared pipeline pins npm 11.What this changes
actions/setup-node@v4useblacksmith/setup-node@v5npm install -g npm@latestnpm install -g npm@11NODE_AUTH_TOKENreleasetrigger onlyrelease+workflow_dispatch--provenance=falsestays: Blacksmith counts as a self-hosted runner, and npm only supports provenance from GitHub-hosted runners.workflow_dispatchmatters for recovery.gh run rerunreplays the workflow file from the tagged commit, so it replays the failure too. Dispatching from a branch uses the current file.References
e19e9f79-9122-4670-a0ae-63f4316d5592— Flowcore SDK canonical npm publish on Blacksmith without an npm tokend474dd0d-470d-49cc-9bab-db3002e06e5a— Trusted Publishing for flowcore-io npm packagesflowcore-io/flowcore-pathways.github/workflows/build.yml— the working referenceTest plan