Skip to content

fix(ci): publish to npm the way the other Flowcore libraries do - #97

Merged
jbiskur merged 1 commit into
mainfrom
fix/npm-publish-blacksmith-oidc
Sep 15, 2026
Merged

jbiskur merged 1 commit into
mainfrom
fix/npm-publish-blacksmith-oidc

Conversation

@jbiskur

@jbiskur jbiskur commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

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 to NODE_AUTH_TOKEN — a classic token, and npm revoked those in March 2025.

npm error 404 Not Found - PUT https://registry.npmjs.org/@flowcore%2fdata-pump

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@v5 injects a transient token over OIDC instead. That is what @flowcore/pathways and @flowcore/sdk already use.

2. A floating npm on a pinned node

The job ran npm install -g npm@latest on node 20. npm 12 raised its engine requirement to ^22.22.2 || ^24.15.0 || >=26, so the step died with EBADENGINE before npm publish was ever reached. The shared pipeline pins npm 11.

What this changes

Before After
actions/setup-node@v4 useblacksmith/setup-node@v5
node 20.x node 24.x
npm install -g npm@latest npm install -g npm@11
implicit NODE_AUTH_TOKEN no token, OIDC
lint + build lint + test + build
release trigger only release + workflow_dispatch

--provenance=false stays: Blacksmith counts as a self-hosted runner, and npm only supports provenance from GitHub-hosted runners.

workflow_dispatch matters for recovery. gh run rerun replays the workflow file from the tagged commit, so it replays the failure too. Dispatching from a branch uses the current file.

References

  • Usable e19e9f79-9122-4670-a0ae-63f4316d5592 — Flowcore SDK canonical npm publish on Blacksmith without an npm token
  • Usable d474dd0d-470d-49cc-9bab-db3002e06e5a — Trusted Publishing for flowcore-io npm packages
  • flowcore-io/flowcore-pathways .github/workflows/build.yml — the working reference

Test plan

  • CI green
  • Dispatch the workflow on main and confirm 0.23.0 lands on npm

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>
@jbiskur
jbiskur merged commit 6f6df28 into main Sep 15, 2026
3 checks passed
@jbiskur
jbiskur deleted the fix/npm-publish-blacksmith-oidc branch September 15, 2026 12:25
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