Skip to content

Add node engines floor and npm trusted-publishing release workflow - #9

Merged
tylerhogarth merged 2 commits into
mainfrom
fix/npm-release-prep
Sep 1, 2026
Merged

Add node engines floor and npm trusted-publishing release workflow#9
tylerhogarth merged 2 commits into
mainfrom
fix/npm-release-prep

Conversation

@tylerhogarth

@tylerhogarth tylerhogarth commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Prepares the package for npm distribution: consumers install the node-target bundle, and releases after the first one publish from CI without a long-lived npm token.

Changes

  • Packaging: package.json now declares node: >=20 alongside the existing bun engine. The published dist/cli.js targets node, so the engines field should describe what consumers need, not only what development needs.
  • Release workflow: .github/workflows/release.yml publishes on v* tags via npm trusted publishing (OIDC). A guard step fails the run if the tag does not match the package.json version. npm publish still triggers prepublishOnly, so the checks and the node-target build run before anything ships. The publish job runs in a release environment so required-reviewer approval and trusted-publisher scoping can be layered on in repo settings.
  • Supply-chain hardening (both workflows): actions are pinned to commit SHAs instead of mutable tags, bun and npm are pinned to exact versions, and permissions are declared explicitly at least privilege (contents: read, with id-token: write only on the publish job).

Why

Trusted publishing avoids storing an npm token in repo secrets and attaches a provenance attestation to each release, which matters for a public package operators install globally. The first release must be published manually because npm only lets you configure a trusted publisher on an existing package; the workflow header documents this. SHA-pinning and exact toolchain versions ensure a moved tag or a compromised "latest" cannot alter what gets built or published.

🤖 Generated with Claude Code

tylerhogarth and others added 2 commits September 1, 2026 15:08
The published bundle targets node, so declare node >=20 alongside the
bun engine used for development. The release workflow publishes on v*
tags via npm trusted publishing (OIDC, provenance attached), with a
guard that the tag matches package.json. The first release still has
to be published manually before the trusted publisher can be
configured on npmjs.com.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Pin actions to commit SHAs so a moved tag cannot inject code, pin bun
and npm to exact versions so the publish toolchain is reproducible,
declare least-privilege permissions explicitly in both workflows, and
gate the publish job behind a release environment so required-reviewer
approval and trusted-publisher scoping can be configured in repo
settings.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tylerhogarth
tylerhogarth merged commit ee4a1e6 into main Sep 1, 2026
1 check passed
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