Skip to content

fix(ci): use --output-dir instead of removed --artifacts-dir napi flag#51

Merged
27Bslash6 merged 1 commit into
mainfrom
ci/fix-napi-artifacts-flag
May 17, 2026
Merged

fix(ci): use --output-dir instead of removed --artifacts-dir napi flag#51
27Bslash6 merged 1 commit into
mainfrom
ci/fix-napi-artifacts-flag

Conversation

@27Bslash6
Copy link
Copy Markdown
Contributor

@27Bslash6 27Bslash6 commented May 17, 2026

Summary

The `build-native.yml` publish step has been broken since the @napi-rs/cli v3 upgrade. The `Move artifacts to platform packages` step calls:

```yaml
npx napi artifacts --artifacts-dir artifacts
```

@napi-rs/cli v3 renamed that flag to `--output-dir` (also accepts `-o` / `-d`). The old flag name was removed entirely — passing it now produces:

```
Unsupported option name ("--artifacts-dir").
```

This silently broke publication of the 5 native platform packages and the main `@cachekit-io/cachekit-core-ts` package. The `cachekit-core-ts-v0.1.1` tag (pushed 2026-04-26) attempted to publish via run `24957357035` and failed at this step, which is why npm still only has `cachekit-core-ts@0.1.0` and zero platform packages.

Verification

Ran `napi artifacts --help` against @napi-rs/cli@3.5.1 locally (the exact version pinned in `packages/cachekit-core-ts/package.json`):

```
--output-dir,-o,-d #0 Path to the folder where all built .node
files put, same as --output-dir of build command
```

No other flag changes affect the publish step. The download target directory (`packages/cachekit-core-ts/artifacts`) is unchanged.

Why this matters now

This is step 1 of the bootstrap path for #50 (OIDC trusted publishing). The plan agreed with @27Bslash6:

  1. This PR — fix napi flag so the publish step can actually run
  2. After merge: cut a real 0.1.2 release (skipping the ghost 0.1.1 tag that never reached npm)
  3. After that ships, configure trusted publishers for all 7 npm packages (2 main + 5 platform)
  4. Merge ci: switch npm publish to OIDC trusted publishing (removes NPM_TOKEN) #50 (currently draft)

Test plan

  • `actionlint` clean
  • CI green on this PR
  • After merge + first `cachekit-core-ts-v*` tag, verify the build-native publish job completes the artifact-move step successfully

Summary by CodeRabbit

  • Chores
    • Updated build workflow configuration to align with the latest tooling version, ensuring continued compatibility with the native build process.

Review Change Stack

@napi-rs/cli v3 renamed the artifacts-collection flag from
--artifacts-dir to --output-dir (also accepts -o / -d). The
build-native.yml publish job still passed --artifacts-dir, so the
"Move artifacts to platform packages" step failed with
"Unsupported option name" on the cachekit-core-ts-v0.1.1 tag push
(run id 24957357035), blocking publication of all 5 platform
packages plus the main core-ts package.

Verified against napi artifacts --help in @napi-rs/cli@3.5.1
locally:
  --output-dir,-o,-d #0    Path to the folder where all built
                           .node files put, same as --output-dir
                           of build command

No other flag deprecations affect the publish step. The download
target directory (packages/cachekit-core-ts/artifacts) is unchanged.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ce483de4-f289-4328-a205-7658d92b1be3

📥 Commits

Reviewing files that changed from the base of the PR and between 1cc38db and d9275ff.

📒 Files selected for processing (1)
  • .github/workflows/build-native.yml

📝 Walkthrough

Walkthrough

The build-native.yml workflow is updated to use the renamed --output-dir flag when invoking npx napi artifacts, replacing the deprecated --artifacts-dir option to maintain compatibility with @napi-rs/cli v3.

Changes

N-API CLI Compatibility

Layer / File(s) Summary
Update napi artifacts command for v3 compatibility
.github/workflows/build-native.yml
The publish job's npx napi artifacts command is updated from --artifacts-dir artifacts to --output-dir artifacts with an inline comment noting the @napi-rs/cli v3 flag rename.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A flag, a change, a version bump—
From artifacts-dir to output-dir we jump!
CLI v3 calls, and workflows obey,
The native build artifacts find their way! 🎯

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: updating a CI workflow flag from --artifacts-dir to --output-dir in the napi command, which directly matches the file changes and PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@27Bslash6 27Bslash6 merged commit 6883563 into main May 17, 2026
14 checks passed
@27Bslash6 27Bslash6 deleted the ci/fix-napi-artifacts-flag branch May 17, 2026 02:10
27Bslash6 added a commit that referenced this pull request May 17, 2026
…2 release (#52)

## Summary

Two real documentation fixes that double as the trigger commit for the
0.1.2 recovery release.

### `packages/cachekit/README.md`

- `Requirements: Node.js 18+` was stale. PR #47 bumped `engines.node` to
`>=22.0.0` across all packages. README now matches: `Node.js 22+`.
- Added a short version-history note explaining the `0.1.0 → 0.1.2` jump
on npm so consumers don't think 0.1.1 is missing or yanked.

### `packages/cachekit-core-ts/README.md` (new)

Every npm-published package should have a README. This one didn't. Added
a minimal one covering:

- What the package is and that consumers shouldn't install it directly
- The 5 prebuilt platform packages and how `optionalDependencies`
selects one
- A summary of the public N-API surface
- The same 0.1.0 → 0.1.2 version note

## Why this is the bootstrap commit for 0.1.2

The commit touches both `packages/cachekit/` and
`packages/cachekit-core-ts/` paths so release-please picks both packages
up for a coordinated release. The `Release-As: 0.1.2` trailer skips
0.1.1 (which exists as a git tag but never reached npm) and forces
release-please to propose 0.1.2 directly.

Type is `docs:` because that's what the changes honestly are — no code
behavior changes. The `Release-As:` trailer is what triggers the
release, not the type.

## What happens after this merges

1. release-please.yml fires on push to main
2. release-please scans commits since the last published manifest, sees
the `Release-As: 0.1.2` trailer and the path touches → opens a release
PR titled `chore: release main` proposing 0.1.2 for both packages
3. Merging that release PR cuts tags `cachekit-v0.1.2` and
`cachekit-core-ts-v0.1.2`
4. `release-please.yml publish-cachekit` runs (auth fix from PR #45 is
in place) → publishes `@cachekit-io/cachekit@0.1.2`
5. The core-ts tag triggers `build-native.yml` → publishes
`@cachekit-io/cachekit-core-ts@0.1.2` + creates all 5 platform packages
on npm (napi flag fix from PR #51 is in place)

After step 5, all 7 packages exist on npm — at which point you can:
6. Configure trusted publishers on npmjs.com for each
7. Take PR #50 out of draft and merge it
8. Delete the `NPM_TOKEN` repo secret after the next OIDC-based release
confirms the loop

## Fallback if release-please ignores `Release-As:` on a `docs:` commit

If release-please's defaults don't pick up `Release-As:` from a
non-releasing commit type, the fallback is to:

- Bump both `package.json` files to 0.1.2 directly
- Update `.release-please-manifest.json` to 0.1.2 for both packages
- Manually create and push the tags

I'd open that as a follow-up PR if needed — keeping the doc-fix and the
release-trigger separate.

## Test plan

- [x] Local validation via prek (no hooks affected by markdown-only
changes)
- [ ] CI green on this PR
- [ ] After merge: confirm release-please opens a 0.1.2 PR within a few
minutes
- [ ] Merge the release PR and watch both publish workflows go green

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Added comprehensive documentation for the native binding package,
including installation guidance and platform support details
  * Updated minimum Node.js version requirement to 22+
  * Clarified version and release information

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/cachekit-io/cachekit-ts/pull/52?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
27Bslash6 added a commit that referenced this pull request May 17, 2026
## Summary

Manually applies what release-please would have done if the docs-only
trigger commit in #52 had been a "user-facing" type. Release-please
skips `docs`/`chore`/`ci`/etc. commits even when `Release-As:` is
present — `Release-As:` overrides the *version*, not the release-trigger
*gate*.

Rather than fake a `fix:` commit (which would have been dishonest, per
the feedback on #52's earlier draft), this PR bypasses release-please
entirely for the one-time recovery. Future releases use the normal
release-please flow.

## What changes

| File | Change |
|---|---|
| `.release-please-manifest.json` | Both packages bumped to `0.1.2` so
release-please future runs treat 0.1.2 as the last released state |
| `packages/cachekit/package.json` | `version: 0.1.1 → 0.1.2` |
| `packages/cachekit-core-ts/package.json` | `version: 0.1.1 → 0.1.2` |
| `packages/cachekit/CHANGELOG.md` | New `## [0.1.2]` section explaining
the 0.1.1 → 0.1.2 history |
| `packages/cachekit-core-ts/CHANGELOG.md` | Same |

## Manual steps after this merges

1. Tag the merge commit and push:
   ```bash
   git checkout main && git pull
   git tag cachekit-v0.1.2 -m "@cachekit-io/cachekit 0.1.2"
git tag cachekit-core-ts-v0.1.2 -m "@cachekit-io/cachekit-core-ts 0.1.2"
   git push origin cachekit-v0.1.2 cachekit-core-ts-v0.1.2
   ```

2. The `cachekit-core-ts-v0.1.2` tag triggers `build-native.yml` →
publishes `@cachekit-io/cachekit-core-ts@0.1.2` + creates all 5 platform
packages on npm (napi flag fix from #51 is in place).

3. `workflow_dispatch release-please.yml` with `force_release: true` →
publishes `@cachekit-io/cachekit@0.1.2`. The release-please job inside
will skip (no user-facing commits since 0.1.1), but the
`publish-cachekit` job has `force_release == 'true'` as a fire condition
and will check out `github.sha` (main HEAD, now 0.1.2) and publish.

4. Verify all 7 packages exist on npm:
   ```bash
   for pkg in @cachekit-io/cachekit @cachekit-io/cachekit-core-ts \
              @cachekit-io/cachekit-core-ts-linux-x64-gnu \
              @cachekit-io/cachekit-core-ts-linux-arm64-gnu \
              @cachekit-io/cachekit-core-ts-darwin-x64 \
              @cachekit-io/cachekit-core-ts-darwin-arm64 \
              @cachekit-io/cachekit-core-ts-win32-x64-msvc; do
     echo "$pkg: $(npm view "$pkg" version 2>&1)"
   done
   ```

5. Configure trusted publishers on npmjs.com for each of the 7 packages.

6. Take #50 out of draft and merge it. Next release uses OIDC; no
`NPM_TOKEN` needed.

7. Delete the `NPM_TOKEN` repo secret.

## Why this isn't tagged by release-please

Release-please reads the manifest to know what was last released and
proposes the next version from commit history. Once the manifest claims
0.1.2 is already released, release-please will look for commits *after*
this PR for the next release. No release PR will be generated for 0.1.2
— that's the whole point of the manual bootstrap.

## Test plan

- [x] `pnpm install` confirms lockfile already in sync (workspace deps
use `workspace:*`)
- [x] CI green on this PR
- [ ] After merge: manually tag + push (step 1 above)
- [ ] Verify `build-native.yml` run on the tag succeeds end-to-end
(including the previously-broken artifact-move step)
- [ ] Verify `workflow_dispatch` release-please publish-cachekit
succeeds
- [ ] Verify all 7 packages on npm at 0.1.2

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **Chores**
  * Released version 0.1.2 for cachekit and cachekit-core-ts packages.
  * Updated minimum Node.js requirement to version 22+.
  
* **Documentation**
  * Added documentation covering platform packages and N-API surface.
* Updated changelog entries with release details and version jump
explanation.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/cachekit-io/cachekit-ts/pull/53?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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