mirror of
https://github.com/lancedb/lancedb.git
synced 2026-01-16 00:33:01 +00:00
Changes: * Refactors the Node module to load the shared library from a separate package. When a user does `npm install vectordb`, the correct optional dependency is automatically downloaded by npm. * Brings Rust and Node versions in alignment at 0.1.2. * Add scripts and instructions to build Linux and MacOS node artifacts locally. * Add instructions for publishing the npm module and crates.
168 lines
4.8 KiB
YAML
168 lines
4.8 KiB
YAML
name: Prepare Release
|
|
|
|
# NOTE: Python is a separate release for now.
|
|
|
|
# Currently disabled until it can be completed.
|
|
# on:
|
|
# push:
|
|
# tags:
|
|
# - v*
|
|
|
|
jobs:
|
|
draft-release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: softprops/action-gh-release@v1
|
|
with:
|
|
draft: true
|
|
prerelease: true # hardcoded on for now
|
|
generate_release_notes: true
|
|
|
|
rust:
|
|
runs-on: ubuntu-latest
|
|
needs: draft-release
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
working-directory: rust/vectordb
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
lfs: true
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y protobuf-compiler libssl-dev
|
|
- name: Package Rust
|
|
run: cargo package --all-features
|
|
- uses: softprops/action-gh-release@v1
|
|
with:
|
|
draft: true
|
|
files: target/package/vectordb-*.crate
|
|
fail_on_unmatched_files: true
|
|
|
|
node:
|
|
runs-on: ubuntu-latest
|
|
needs: draft-release
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
working-directory: node
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 20
|
|
cache: 'npm'
|
|
cache-dependency-path: node/package-lock.json
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y protobuf-compiler libssl-dev
|
|
- name: Build
|
|
run: |
|
|
npm ci
|
|
npm run tsc
|
|
npm pack
|
|
- uses: softprops/action-gh-release@v1
|
|
with:
|
|
draft: true
|
|
files: node/vectordb-*.tgz
|
|
fail_on_unmatched_files: true
|
|
|
|
node-macos:
|
|
runs-on: macos-12
|
|
needs: draft-release
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
target: [x86_64-apple-darwin, aarch64-apple-darwin]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v33
|
|
- name: Install system dependencies
|
|
run: brew install protobuf
|
|
- name: Install npm dependencies
|
|
run: |
|
|
cd node
|
|
npm ci
|
|
- name: Install rustup target
|
|
if: ${{ matrix.target == 'aarch64-apple-darwin' }}
|
|
run: rustup target add aarch64-apple-darwin
|
|
- name: Build MacOS native node modules
|
|
run: bash ci/build_macos_artifacts.sh ${{ matrix.target }}
|
|
- uses: softprops/action-gh-release@v1
|
|
with:
|
|
draft: true
|
|
files: node/dist/lancedb-vectordb-darwin*.tgz
|
|
fail_on_unmatched_files: true
|
|
|
|
node-linux:
|
|
name: node-linux (${{ matrix.arch}}-unknown-linux-${{ matrix.libc }})
|
|
runs-on: ubuntu-latest
|
|
needs: draft-release
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
libc:
|
|
- gnu
|
|
# TODO: re-enable musl once we have refactored to pre-built containers
|
|
# Right now we have to build node from source which is too expensive.
|
|
# - musl
|
|
arch:
|
|
- x86_64
|
|
# Building on aarch64 is too slow for now
|
|
# - aarch64
|
|
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: Set up QEMU
|
|
if: ${{ matrix.arch == 'aarch64' }}
|
|
uses: docker/setup-qemu-action@v2
|
|
with:
|
|
platforms: arm64
|
|
- name: Build Linux GNU native node modules
|
|
if: ${{ matrix.libc == 'gnu' }}
|
|
run: |
|
|
docker run \
|
|
-v $(pwd):/io -w /io \
|
|
quay.io/pypa/manylinux2014_${{ matrix.arch }} \
|
|
bash ci/build_linux_artifacts.sh ${{ matrix.arch }}-unknown-linux-gnu
|
|
- name: Build musl Linux native node modules
|
|
if: ${{ matrix.libc == 'musl' }}
|
|
run: |
|
|
docker run --platform linux/arm64/v8 \
|
|
-v $(pwd):/io -w /io \
|
|
quay.io/pypa/musllinux_1_1_${{ matrix.arch }} \
|
|
bash ci/build_linux_artifacts.sh ${{ matrix.arch }}-unknown-linux-musl
|
|
- uses: softprops/action-gh-release@v1
|
|
with:
|
|
draft: true
|
|
files: node/dist/lancedb-vectordb-linux*.tgz
|
|
fail_on_unmatched_files: true
|
|
|
|
release:
|
|
needs: [rust, node, node-macos, node-linux]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/download-artifact@v3
|
|
- name: Publish to NPM
|
|
run: |
|
|
for filename in node/dist/*.tgz; do
|
|
npm publish --dry-run $filename
|
|
done
|
|
- name: Publish to crates.io
|
|
env:
|
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
|
run: |
|
|
cargo publish --dry-run --no-verify rust/target/vectordb-*.crate
|
|
# - uses: softprops/action-gh-release@v1
|
|
# with:
|
|
# draft: false
|