Compare commits

..

1 Commits

Author SHA1 Message Date
Will Jones
19397c6188 fixes for action 2023-05-23 18:59:45 -07:00
3 changed files with 14 additions and 36 deletions

View File

@@ -38,7 +38,8 @@ jobs:
- uses: softprops/action-gh-release@v1 - uses: softprops/action-gh-release@v1
with: with:
draft: true draft: true
files: target/vectordb-*.crate files: |
rust/target/vectordb-*.crate
python: python:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -57,9 +58,7 @@ jobs:
with: with:
python-version: "3.10" python-version: "3.10"
- name: Build wheel - name: Build wheel
run: | run: python setup.py sdist bdist_wheel
pip install wheel
python setup.py sdist bdist_wheel
- uses: softprops/action-gh-release@v1 - uses: softprops/action-gh-release@v1
with: with:
draft: true draft: true
@@ -82,6 +81,7 @@ jobs:
node-version: 20 node-version: 20
cache: 'npm' cache: 'npm'
cache-dependency-path: node/package-lock.json cache-dependency-path: node/package-lock.json
- uses: Swatinem/rust-cache@v2
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo apt update sudo apt update
@@ -100,7 +100,6 @@ jobs:
runs-on: macos-12 runs-on: macos-12
needs: draft-release needs: draft-release
strategy: strategy:
fail-fast: false
matrix: matrix:
target: [x86_64-apple-darwin, aarch64-apple-darwin] target: [x86_64-apple-darwin, aarch64-apple-darwin]
steps: steps:
@@ -109,9 +108,7 @@ jobs:
- name: Install system dependencies - name: Install system dependencies
run: brew install protobuf run: brew install protobuf
- name: Install npm dependencies - name: Install npm dependencies
run: | run: npm ci
cd node
npm ci
- name: Build MacOS native node modules - name: Build MacOS native node modules
run: bash ci/build_macos_artifacts.sh ${{ matrix.target }} run: bash ci/build_macos_artifacts.sh ${{ matrix.target }}
- uses: softprops/action-gh-release@v1 - uses: softprops/action-gh-release@v1
@@ -123,29 +120,22 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: draft-release needs: draft-release
strategy: strategy:
fail-fast: false
matrix: matrix:
target: target:
- x86_64-unknown-linux-gnu - x86_64-unknown-linux-gnu:centos
- aarch64-unknown-linux-gnu - aarch64-unknown-linux-gnu:centos
- aarch64-unknown-linux-musl - aarch64-unknown-linux-musl
- x86_64-unknown-linux-musl - x86_64-unknown-linux-musl
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Setup Rust
uses: ATiltedTree/setup-rust@v1
with:
rust-version: stable
- name: Install system dependencies - name: Install system dependencies
run: | run: |
sudo apt update sudo apt update
sudo apt install -y protobuf-compiler libssl-dev sudo apt install -y protobuf-compiler libssl-dev
cargo install cross cargo install cross
- name: Install npm dependencies - name: Install npm dependencies
run: | run: npm ci
cd node
npm ci
- name: Build Linux native node modules - name: Build Linux native node modules
run: bash ci/build_linux_artifacts.sh ${{ matrix.target }} run: bash ci/build_linux_artifacts.sh ${{ matrix.target }}
- uses: softprops/action-gh-release@v1 - uses: softprops/action-gh-release@v1

View File

@@ -2,25 +2,13 @@
[target.x86_64-unknown-linux-gnu] [target.x86_64-unknown-linux-gnu]
pre-build = [ pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH", "dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH protobuf-compiler:$CROSS_DEB_ARCH", "apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH protobuf-compiler",
] ]
image = "ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main-centos" image = "ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main-centos"
[target.aarch64-unknown-linux-gnu] [target.aarch64-unknown-linux-gnu]
pre-build = [ pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH", "dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH protobuf-compiler:$CROSS_DEB_ARCH", "apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH protobuf-compiler",
] ]
image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main-centos" image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main-centos"
[target.x86_64-unknown-linux-musl]
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH protobuf-compiler:$CROSS_DEB_ARCH",
]
[target.aarch64-unknown-linux-musl]
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH protobuf-compiler:$CROSS_DEB_ARCH",
]

View File

@@ -20,10 +20,10 @@ build_node_binaries() {
do do
echo "Building node library for $target" echo "Building node library for $target"
# cross doesn't yet pass this down to Docker, so we do it ourselves. # cross doesn't yet pass this down to Docker, so we do it ourselves.
export CROSS_CONTAINER_OPTS="--platform linux/amd64" if [[ $target == x86_64* ]]; then
if [[ $target == *musl ]]; then export CROSS_CONTAINER_OPTS="--platform linux/amd64"
# This is needed for cargo to allow build cdylibs with musl else
RUSTFLAGS="-C target-feature=-crt-static" export CROSS_CONTAINER_OPTS="--platform linux/arm64/v8"
fi fi
npm run cross-release -- --target $target npm run cross-release -- --target $target
npm run pack-build -- --target $target npm run pack-build -- --target $target