Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Node-API Build Matrix

on:
push:
pull_request:
release:
types: [published]

permissions:
contents: write # upload release assets

jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
include:
- { name: linux-x64-gnu, os: ubuntu-24.04 }
- { name: linux-arm64-gnu, os: ubuntu-24.04-arm }
- { name: linux-x64-musl, os: ubuntu-24.04, container: "node:22-alpine" }
- { name: darwin-universal, os: macos-latest, cmake: "'-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64' -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0" }
- { name: win32-x64-msvc, os: windows-latest, cmake: "-A x64" }
- { name: win32-ia32-msvc, os: windows-latest, cmake: "-A Win32", notest: true }
- { name: win32-arm64-msvc, os: windows-11-arm, cmake: "-A ARM64" }
- { name: win32-x64-mingw, os: windows-latest, msys2: CLANG64, cmake: "-G Ninja" }
defaults:
run:
shell: ${{ matrix.msys2 && 'msys2 {0}' || 'bash' }}
steps:
- uses: actions/checkout@v5
- if: matrix.container
shell: sh
run: apk add --no-cache bash cmake make gcc musl-dev tar github-cli
- if: matrix.msys2
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msys2 }}
pacboy: cc:p cmake:p ninja:p
path-type: inherit # makes the node installed by setup-node visible to ctest
- if: ${{ !matrix.container }}
uses: actions/setup-node@v5
with: { node-version: 22 }
- name: Configure
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$PWD/dist" ${{ matrix.cmake }}
- name: Build
run: cmake --build build --config Release
- name: Test (addons loaded by node)
if: ${{ !matrix.notest }}
run: ctest --test-dir build -C Release --output-on-failure
- name: Install and package
run: |
cmake --install build --config Release
tar -czf node-api-stub-${{ matrix.name }}.tar.gz -C dist .
- uses: actions/upload-artifact@v6
with:
name: node-api-stub-${{ matrix.name }}
path: node-api-stub-${{ matrix.name }}.tar.gz
- if: github.event_name == 'release'
env: { GH_TOKEN: "${{ github.token }}" }
run: gh release upload "${{ github.event.release.tag_name }}" node-api-stub-${{ matrix.name }}.tar.gz --clobber
151 changes: 0 additions & 151 deletions .github/workflows/node-api.yml

This file was deleted.

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
build
build/
build-*/
dist/
.tmp-node-api-headers/
.DS_Store
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# node-api-stub Changelog

## Unreleased Version 10.0.0

### Notable changes

- Updated to Node-API version 10. Headers and the `.def` files are vendored
unmodified from `node-api-headers` 1.9.0 (155 symbols); 9 symbols were missing
in 8.0.0.
- New `NodeApi::NodeApi` CMake target that applies the right link mechanism for
each platform: import library for `NODE.EXE` with a delay-load hook on
Windows (MSVC and MinGW), `-U` for each Node-API symbol on macOS, nothing on
ELF platforms.
- The project can be consumed with `FetchContent`, `add_subdirectory` and
`find_package(NodeApi)` (exported targets and package config files).
- The stub source is generated from the `.def` file. Static and shared stub
libraries are optional and abort with a message when called, instead of
returning `napi_ok` with uninitialised results.
- New tests that load the addons in Node.js, including the `-Bsymbolic` case.
- New build matrix: Linux x64/arm64 (glibc and musl), macOS universal, Windows
x64/x86/arm64 (MSVC) and x64 (MinGW).

### Breaking changes

- Headers moved from the repository root to `include/`; `node_api.c` removed.
- The `node_api` target and `libnode_api.a` are replaced by `NodeApi::NodeApi`
and, for the static stub, `NodeApi::stub` / `libnode_api_stub.a`
(`NodeApi::legacy` is an alias of it).

## 2021-03-27 Version 8.0.0, @NickNaso

### Notable changes
Expand Down
Loading
Loading