Skip to content

ci(node): make npm-publish tag optional (default: latest master)#17

Merged
artiz merged 6 commits into
masterfrom
claude/nodejs-bun-typescript-bindings-8pk2wk
Jul 1, 2026
Merged

ci(node): make npm-publish tag optional (default: latest master)#17
artiz merged 6 commits into
masterfrom
claude/nodejs-bun-typescript-bindings-8pk2wk

Conversation

@artiz

@artiz artiz commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Follow-up to the merged Node/Bun bindings PR (#15). Makes the npm publish workflow's tag input optional so it can be run without typing a tag.

What changed

  • .github/workflows/npm-publish.yml: the workflow_dispatch tag input is now optional.
    • Blank → builds the latest master: checks out the dispatch ref (inputs.tag || github.ref) and derives the npm version from the workspace Cargo.toml.
    • A tag (e.g. v0.7.0) → checks out and builds that release instead.
    • The optional version input still overrides either.
  • Both the build-matrix and publish jobs check out the resolved ref.
  • README note updated to reflect the default-to-master behavior.

Usage

gh workflow run npm-publish.yml                 # latest master
gh workflow run npm-publish.yml -f tag=v0.7.0   # a specific release

…or Run workflow in the Actions tab with the field left empty.

The existing already-published guard makes a blank/master run a safe no-op when that version is already on npm.

Notes

  • Still requires the NPM_TOKEN repo secret and ARM64 Linux runners (ubuntu-24.04-arm) enabled.
  • The cross-platform build matrix, per-platform package assembly, and publish steps are unchanged from Add Node.js / Bun bindings via napi-rs #15.

🤖 Generated with Claude Code


Generated by Claude Code

claude added 6 commits July 1, 2026 09:56
The workflow_dispatch `tag` input is now optional: blank builds the latest
master (checking out the dispatch ref and deriving the npm version from the
workspace Cargo.toml), or pass a tag to build that release instead. An explicit
`version` input still overrides either.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L7XwjsWSHWjrh39JxMLuB3
GitHub-hosted macOS runners are blocked in this environment, and darwin can't
be cross-compiled on Linux (needs the Apple SDK), so the Intel-mac job hung
waiting for a runner. Remove both darwin targets from the publish matrix and
from napi.triples so the workflow ships prebuilds for Linux x64/arm64 and
Windows x64; macOS users build from source. The matrix comment documents how to
re-add darwin (with x86_64 cross-compiled on an arm runner) once macOS runners
are available.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L7XwjsWSHWjrh39JxMLuB3
GitHub is retiring Node 20 as the action host runtime. Bump the flagged
first-party actions to their Node 24 majors in both workflows:
actions/checkout, actions/setup-node, actions/upload-artifact,
actions/download-artifact → @v5. Drop-in (same inputs); clears the deprecation
warnings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L7XwjsWSHWjrh39JxMLuB3
The publish failed with 403: the npm token is scoped to @artiz.ru but the
packages were unscoped (fleischwolf, fleischwolf-<triple>), which the token
can't create. Rename the package to @artiz.ru/fleischwolf so it matches the
token's scope — no token change needed. napi derives the platform packages as
@artiz.ru/fleischwolf-<triple> and the loader's fallback require accordingly;
both the main and platform packages publish with --access public (scoped
packages are private by default). Update imports, self-reference, examples,
READMEs, and the workflow's package-name references. The native binary base
name stays fleischwolf.<triple>.node.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L7XwjsWSHWjrh39JxMLuB3
…xamples

- Root README: lead the Node/Bun section with `npm install fleischwolf`
  (prebuilt, no Rust needed) and a simple in-memory + file usage example;
  point at the examples folder.
- examples/ is now a self-contained consumer project: add package.json
  depending on `fleischwolf` (^0.6.1) so `npm install` in the folder resolves
  the published package, with scripts to run each example. Add examples/.gitignore
  (node_modules, lockfiles, artifacts). Update the crate's example scripts and
  README to the `cd examples && npm install` flow.

Verified: `npm install` in examples/ pulls the published package + platform
binary, and both node-basic.mjs and bun-basic.ts run against it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L7XwjsWSHWjrh39JxMLuB3
@artiz artiz merged commit 4916edd into master Jul 1, 2026
3 checks passed
@artiz artiz deleted the claude/nodejs-bun-typescript-bindings-8pk2wk branch July 1, 2026 11:43
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.

2 participants