Skip to content

release: add npm publish workflow (OIDC trusted publishing) - #11

Merged
moskovich merged 3 commits into
mainfrom
npm-release-workflow
Jul 25, 2026
Merged

release: add npm publish workflow (OIDC trusted publishing)#11
moskovich merged 3 commits into
mainfrom
npm-release-workflow

Conversation

@moskovich

@moskovich moskovich commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

What

Adds a Release workflow that publishes @feralfile/source-resolver to npm on GitHub release, modeled on ff-cli's pipeline: CI reuse via workflow_call, tag↔package.json version check (bare tags, no v prefix), npm publish --provenance, and a registry verification pass. Bumps the package to 1.0.0 — the library is stable and in production as ff-cli's find backend.

Why

ff-cli depends on this repo as a git-URL dependency, and npm 12's supply-chain defaults (allow-git=none) refuse git deps — so npm i -g @feralfile/cli currently fails outright for npm 12 users, and ff-cli contributors need --allow-git=all to install. Publishing the resolver to the registry and swapping ff-cli's dep to a semver range fixes both without weakening npm's protections. Companion PR: feral-file/ff-cli#96.

Publish auth

Releases are fully automated (create a GitHub release → workflow publishes), following ff-cli's two-era arc:

  • Bootstrap (first publish): npm cannot configure a trusted publisher for a package that does not exist yet (npm/cli#8544), so the publish step uses an NPM_TOKEN repo secret when present — the same token-based auth ff-cli's releases used before its OIDC switch (ff-cli #61). One-time setup: create a granular automation token with publish rights on the @feralfile scope and add it as the NPM_TOKEN secret on this repo.
  • Steady state: once the package exists, wire the trusted publisher on npmjs.com (GitHub Actions, org feral-file, repo ff-source-resolver, workflow release.yml) and delete the secret. The workflow detects the absent token and publishes via OIDC — no workflow change needed.

The publish step is idempotent: re-running a release for an already-published version verifies instead of failing.

Testing

Publishes @feralfile/source-resolver to npm on GitHub release, modeled
on ff-cli's release pipeline: reuse CI via workflow_call, verify the
tag matches package.json (bare tags, no v prefix), publish with
provenance, then verify the registry version. The publish step is
idempotent so the bootstrap release (first publish done manually while
wiring the trusted publisher) can still get a normal release run.

Bump version to 1.0.0: the library is stable and in production use as
ff-cli's find backend.
@moskovich

Copy link
Copy Markdown
Contributor Author

Note on the red check: Live Resolver Fixtures is a pre-existing failure, not from this PR — the nightly scheduled runs on main have failed identically since at least 2026-07-20 (e.g. run 30084622263). One fixture of 99 fails: raster artwork: resolveTokenInfos returns real collection tokens — the raster.art page loads (browser title present) but resolution returns not-found, i.e. site markup drift. Verify (the job the release workflow gates on) passes, and the live suite does not run on release events, so this does not affect the publish pipeline. The raster drift deserves its own fix in the resolver adapters.

npm cannot configure a trusted publisher for a package that does not
exist yet (npm/cli#8544), so the first publish authenticates with an
NPM_TOKEN repo secret when present — the same token-era ff-cli used
before its OIDC switch (ff-cli #61). Once the package exists and the
trusted publisher is wired, delete the secret; the workflow then
publishes via OIDC with no further change.

Also merges main (raster GraphQL fallback + fixture fixes, #12) so this
branch's CI reflects the healed live suite.
@moskovich
moskovich merged commit 0ecfd1c into main Jul 25, 2026
2 checks passed
ngleanh added a commit to feral-file/ff-cli that referenced this pull request Jul 27, 2026
…#96)

* deps: swap @feralfile/source-resolver git URL for npm registry semver

Blocked on the resolver's first npm publish
(feral-file/ff-source-resolver#11). npm 12 defaults allow-git=none, so
the git-URL dependency breaks npm i -g @feralfile/cli for end users and
npm ci for contributors. After the registry publish lands, regenerate
package-lock.json with npm install and drop the README allow-git
workaround note (done here).

Note: ^1.0.0 is cut from current resolver main, two merges ahead of the
old commit pin (playable artwork source resolution + hardening).

* chore(deps): refresh source resolver lockfile

---------

Co-authored-by: Anh Nguyen <ngleanh@gmail.com>
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