diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eaa0043f..0c0905ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,10 +13,19 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest, macos-15-intel] + os: [ubuntu-latest, windows-latest, macos-15-intel] node-version: [20.x, 22.x, 24.x] arch: [x64] include: + - os: macos-latest + node-version: 20.x + arch: arm64 + - os: macos-latest + node-version: 22.x + arch: arm64 + - os: macos-latest + node-version: 24.x + arch: arm64 - os: windows-latest node-version: 20.x arch: x86 @@ -48,23 +57,34 @@ jobs: shell: bash run: npm run prebuild + # Consumers resolve node-addon-api from our semver range, not our lockfile, + # so also build against the newest release to catch header changes early. + - name: Build and test against latest node-addon-api + shell: bash + run: | + npm install --no-save node-addon-api@latest + npm run build + npm run test + test-mingw: - name: Test MinGW (MSYS2 MINGW64) on Windows + name: Test MinGW (MSYS2 UCRT64) on Windows runs-on: windows-latest steps: - name: Checkout code uses: actions/checkout@v6 - - name: Set up MSYS2 with MINGW64 + # MSYS2 no longer builds nodejs for the MINGW64 (msvcrt) environment; + # UCRT64 is its replacement and uses the same GCC/MinGW-w64 toolchain. + - name: Set up MSYS2 with UCRT64 uses: msys2/setup-msys2@v2 with: - msystem: MINGW64 + msystem: UCRT64 update: true install: >- - mingw-w64-x86_64-nodejs - mingw-w64-x86_64-python - mingw-w64-x86_64-gcc + mingw-w64-ucrt-x86_64-nodejs + mingw-w64-ucrt-x86_64-python + mingw-w64-ucrt-x86_64-gcc make - name: Verify MinGW Node.js is active @@ -94,7 +114,10 @@ jobs: shell: msys2 {0} run: | test ! -e node_modules/node-gyp || { echo "local node-gyp shadows the MSYS2 one"; exit 1; } - node-gyp --version + # The UCRT64 package only ships node-gyp.cmd in bin/, which bash can't run, and + # npm's node-gyp-bin shim only resolves correctly when npm sets + # $npm_config_node_gyp for a lifecycle script. Call npm's node-gyp directly. + node "$MINGW_PREFIX/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" --version - name: Build native tests shell: msys2 {0} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ce135909..034f324f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,7 @@ jobs: - os: windows-latest arch: x86 - os: macos-latest - arch: x64 + arch: arm64 - os: macos-15-intel arch: x64 diff --git a/binding.gyp b/binding.gyp index d3fe2dbb..4f3c33dd 100644 --- a/binding.gyp +++ b/binding.gyp @@ -20,8 +20,7 @@ 'xcode_settings': { 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', 'CLANG_CXX_LIBRARY': 'libc++', - 'MACOSX_DEPLOYMENT_TARGET': '10.7', - 'OTHER_CPLUSPLUSFLAGS' : [ '-std=c++11', '-stdlib=libc++' ], + 'MACOSX_DEPLOYMENT_TARGET': '10.15', }, 'msvs_settings': { 'VCCLCompilerTool': { 'ExceptionHandling': 1 }, diff --git a/package-lock.json b/package-lock.json index 7c6c557a..14fec916 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,17 @@ { "name": "@napi-ffi/ffi-napi", - "version": "4.0.7", + "version": "4.0.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@napi-ffi/ffi-napi", - "version": "4.0.7", + "version": "4.0.8", "hasInstallScript": true, "license": "MIT", "dependencies": { "@napi-ffi/get-uv-event-loop-napi-h": "^1.0.6", - "@napi-ffi/ref-napi": "^3.0.9", + "@napi-ffi/ref-napi": "^3.0.10", "@napi-ffi/ref-struct-di": "^1.1.1", "debug": "^4.3.7", "node-addon-api": "^8.2.1", @@ -459,9 +459,9 @@ } }, "node_modules/@napi-ffi/ref-napi": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/@napi-ffi/ref-napi/-/ref-napi-3.0.9.tgz", - "integrity": "sha512-6h5emFwa2DW6Jzah34CTeUvDQe+H9PCpxR/K27eaMIpr1Ye4ts8/KWWOzQHzRbykBnUCBavUGfhLmN1cELNjIw==", + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@napi-ffi/ref-napi/-/ref-napi-3.0.10.tgz", + "integrity": "sha512-4yjPiL7aPV5pyJhUKmVN8H7+bwcaOkYYN7DRqAmURfvn81k8TM35Z6gyvnxzGMaiMMO+nPa2t06EMnWWP0+VeA==", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index d6bc91fc..ac5f4e0f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@napi-ffi/ffi-napi", - "version": "4.0.7", + "version": "4.0.8", "license": "MIT", "author": "Anna Henningsen ", "contributors": [ @@ -33,7 +33,7 @@ "@napi-ffi/get-uv-event-loop-napi-h": "^1.0.6", "node-addon-api": "^8.2.1", "node-gyp-build": "^4.8.2", - "@napi-ffi/ref-napi": "^3.0.9", + "@napi-ffi/ref-napi": "^3.0.10", "@napi-ffi/ref-struct-di": "^1.1.1" }, "devDependencies": { diff --git a/test/binding.gyp b/test/binding.gyp index 910c63a5..b19b7daa 100644 --- a/test/binding.gyp +++ b/test/binding.gyp @@ -16,7 +16,7 @@ 'xcode_settings': { 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', 'CLANG_CXX_LIBRARY': 'libc++', - 'MACOSX_DEPLOYMENT_TARGET': '10.7', + 'MACOSX_DEPLOYMENT_TARGET': '10.15', }, 'msvs_settings': { 'VCCLCompilerTool': { 'ExceptionHandling': 1 },