diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index e61bfe5a..309619dd 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -35,7 +35,7 @@ jobs: with: name: node-package path: | - node/lancedb-vectordb-*.tgz + node/vectordb-*.tgz node-macos: runs-on: macos-12 @@ -116,6 +116,33 @@ jobs: path: | node/dist/lancedb-vectordb-linux*.tgz + node-linux-arm: + name: node-linux (aarch64-unknown-linux-gnu) + runs-on: buildjet-4vcpu-ubuntu-2204-arm + # Only runs on tags that matches the make-release action + if: startsWith(github.ref, 'refs/tags/v') + strategy: + fail-fast: false + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Change owner to root (for npm) + # The docker container is run as root, so we need the files to be owned by root + # Otherwise npm is a nightmare: https://github.com/npm/cli/issues/3773 + run: sudo chown -R root:root . + - name: Build Linux GNU native node modules + run: | + docker run \ + -v $(pwd):/io -w /io \ + rust:1.70-bookworm \ + bash ci/build_linux_artifacts.sh aarch64-unknown-linux-gnu + - name: Upload Linux Artifacts + uses: actions/upload-artifact@v3 + with: + name: native-linux-arm + path: | + node/dist/lancedb-vectordb-linux*.tgz + node-windows: runs-on: windows-2022 # Only runs on tags that matches the make-release action @@ -150,7 +177,7 @@ jobs: node/dist/lancedb-vectordb-win32*.tgz release: - needs: [node, node-macos, node-linux, node-windows] + needs: [node, node-macos, node-linux, node-linux-arm, node-windows] runs-on: ubuntu-latest # Only runs on tags that matches the make-release action if: startsWith(github.ref, 'refs/tags/v') diff --git a/ci/build_linux_artifacts.sh b/ci/build_linux_artifacts.sh index 2a9f6e5f..3a91f3ff 100644 --- a/ci/build_linux_artifacts.sh +++ b/ci/build_linux_artifacts.sh @@ -55,7 +55,11 @@ build_node_binary() { # We don't pass in target, since the native target here already matches # We need to pass OPENSSL_LIB_DIR and OPENSSL_INCLUDE_DIR for static build to work https://github.com/sfackler/rust-openssl/issues/877 - OPENSSL_STATIC=1 OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu OPENSSL_INCLUDE_DIR=/usr/include/openssl/ npm run build-release + if [[ $1 == aarch64-* ]]; then + OPENSSL_STATIC=1 OPENSSL_LIB_DIR=/usr/lib/aarch64-linux-gnu OPENSSL_INCLUDE_DIR=/usr/include/openssl/ npm run build-release + else + OPENSSL_STATIC=1 OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu OPENSSL_INCLUDE_DIR=/usr/include/openssl/ npm run build-release + fi npm run pack-build popd