Skip to content

fix: opt into Node.js 24 for Actions and fix cross-platform dist build - #5

Merged
KasperRagnar merged 1 commit into
masterfrom
feature/github-actions-node24
Apr 27, 2026
Merged

KasperRagnar merged 1 commit into
masterfrom
feature/github-actions-node24

Conversation

@KasperRagnar

Copy link
Copy Markdown
Owner

What changed

GitHub Actions — Node.js 24 opt-in
Added FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true to both workflow files (build.yml and security-scan.yml). This resolves the deprecation warning from the Trivy security scan where actions/checkout@v4 and actions/cache (pulled in internally by actions/setup-node) were flagged as running on Node.js 20, which GitHub is deprecating ahead of a forced migration in June 2026.

Cross-platform dist build fix
npm run dist was failing with spawn UNKNOWN when building Linux/macOS targets from Windows. The root cause was @yao-pkg/pkg trying to spawn Linux/macOS Node.js binaries during V8 bytecode fabrication — which Windows cannot execute.

Fixed by:

  • Adding --no-bytecode --public to the pkg command so source files are bundled as-is instead of compiled bytecode, enabling genuine cross-platform builds from any OS.
  • Removing the explicit scripts: ["dist/**/*.js"] from the pkg config — pkg auto-detects required JS files via the entry point's require chain.

All four platform executables now build successfully from Windows and are correctly renamed with the version number.

…st build

- Add FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true to both workflow files to
  silence the Node.js 20 deprecation warning from actions/checkout and
  actions/cache (pulled in by setup-node). Deadline for mandatory Node 24
  is June 2026.
- Add --no-bytecode --public to pkg dist command so cross-platform builds
  (e.g. Linux/macOS targets from Windows) no longer fail with spawn UNKNOWN
  during V8 bytecode fabrication.
- Remove explicit pkg scripts glob (dist/**/*.js) — pkg auto-detects JS
  files via the require chain from the entry point.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@KasperRagnar
KasperRagnar merged commit 65ad0cb into master Apr 27, 2026
1 check passed
@KasperRagnar
KasperRagnar deleted the feature/github-actions-node24 branch April 27, 2026 17:17
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