Use pre-built ort
, fix builds on Windows
#119
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Dependency matrix | |
on: | |
pull_request: | |
branches: [main] | |
paths: | |
- "flake.nix" | |
- "flake.lock" | |
- ".github/workflows/dependencies.yml" | |
jobs: | |
onnx-nix: | |
strategy: | |
fail-fast: false | |
matrix: | |
package: [ onnxruntime ] | |
target: [ | |
x86_64-unknown-linux-gnu, | |
x86_64-darwin, | |
aarch64-darwin, | |
] | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
cross: false | |
- target: x86_64-darwin | |
os: macos-11 | |
cross: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Setting variables | |
uses: actions/github-script@v6 | |
id: var | |
with: | |
script: | | |
const target = ${{ matrix.cross }} && '-${{ matrix.target }}' || '' | |
const package_name = '${{ matrix.package }}-static' + target | |
core.setOutput('package-name', package_name) | |
- uses: actions/checkout@v3 | |
- run: env | |
- name: Setup nix | |
uses: cachix/install-nix-action@v22 | |
with: | |
github_access_token: "${{ secrets.GITHUB_TOKEN }}" | |
- name: Enable cachix | |
uses: cachix/cachix-action@v12 | |
with: | |
name: bloopai | |
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" | |
- name: Build package ${{matrix.package}}-${{matrix.target}} | |
env: | |
PACKAGE_NAME: ${{ steps.var.outputs.package-name }} | |
run: | | |
package=$(nix build -L --json .#${{ env.PACKAGE_NAME }}) | |
package_path=$(echo $package | jq -r '.[0].outputs.out') | |
echo package_path=$package_path >> $GITHUB_ENV | |
mkdir ${{ env.PACKAGE_NAME }}_bundle | |
cp -r $package_path/* ${{ env.PACKAGE_NAME }}_bundle | |
- name: Upload binaries | |
env: | |
PACKAGE_NAME: ${{ steps.var.outputs.package-name }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: "${{ matrix.package }}_${{ matrix.target }}" | |
path: ${{ env.PACKAGE_NAME }}_bundle | |
qdrant-rustup: | |
strategy: | |
fail-fast: false | |
matrix: | |
package: [ qdrant ] | |
target: [ | |
x86_64-unknown-linux-gnu, | |
x86_64-apple-darwin, | |
aarch64-apple-darwin, | |
] | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
cross: false | |
- target: x86_64-apple-darwin | |
os: macos-11 | |
cross: false | |
- target: aarch64-apple-darwin | |
os: macos-11 | |
cross: true | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Install Rust stable | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
target: ${{ matrix.target }} | |
- uses: cachix/install-nix-action@v22 | |
with: | |
github_access_token: "${{ secrets.GITHUB_TOKEN }}" | |
- name: Install dependencies | |
run: "nix profile install nixpkgs#protobuf" | |
- name: Build qdrant | |
env: | |
VERSION: 1.1.0 | |
run: | | |
cargo install --target ${{ matrix.target }} --git https://github.com/qdrant/qdrant --tag v$VERSION --locked --root . qdrant | |
- name: Upload binaries | |
uses: actions/upload-artifact@v3 | |
with: | |
name: "${{ matrix.package }}_${{ matrix.target }}" | |
path: bin |