From 602e4fe70dcb3e5b0b0288dc616c4e17ca66ee6f Mon Sep 17 00:00:00 2001 From: rUv Date: Fri, 21 Nov 2025 19:53:56 +0000 Subject: [PATCH] fix: Copy .node files from NAPI-RS native output to platform packages - NAPI-RS outputs to npm/core/native/{short-platform}/ - Platform packages are in npm/core/platforms/{full-platform}/ - Add copy step to move binaries to correct location before upload --- .github/workflows/build-native.yml | 38 ++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-native.yml b/.github/workflows/build-native.yml index 5acfce99..8a60223b 100644 --- a/.github/workflows/build-native.yml +++ b/.github/workflows/build-native.yml @@ -77,12 +77,40 @@ jobs: env: CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc - - name: List built files (debug) - working-directory: npm/packages/core + - name: Copy binary to platform package + shell: bash run: | - echo "=== Looking for .node files ===" - find . -name "*.node" -type f || true - ls -R . | grep -E "\.node$" || true + # Map NAPI-RS output directory to platform package directory + case "${{ matrix.settings.platform }}" in + linux-x64-gnu) + SRC="npm/core/native/linux-x64" + ;; + linux-arm64-gnu) + SRC="npm/core/native/linux-arm64" + ;; + darwin-x64) + SRC="npm/core/native/darwin-x64" + ;; + darwin-arm64) + SRC="npm/core/native/darwin-arm64" + ;; + win32-x64-msvc) + SRC="npm/core/native/win32-x64-msvc" + ;; + esac + + DEST="npm/core/platforms/${{ matrix.settings.platform }}" + + echo "Looking for .node files in: $SRC" + ls -la "$SRC" || true + + if [ -f "$SRC/ruvector.node" ]; then + echo "Copying $SRC/ruvector.node to $DEST/" + cp -v "$SRC/ruvector.node" "$DEST/" + else + echo "ERROR: ruvector.node not found in $SRC" + exit 1 + fi - name: Test native module (native platform only) if: |