mirror of
https://github.com/lancedb/lancedb.git
synced 2026-01-10 13:52:58 +00:00
132 lines
3.4 KiB
YAML
132 lines
3.4 KiB
YAML
name: Prepare Release
|
|
|
|
# Based on https://github.com/dherman/neon-prebuild-example/blob/eaa4d33d682e5eb7abbc3da7aed153a1b1acb1b3/.github/workflows/publish.yml
|
|
|
|
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
|
|
|
|
python:
|
|
runs-on: ubuntu-latest
|
|
needs: draft-release
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
working-directory: python
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
lfs: true
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.10
|
|
- name: Build wheel
|
|
run: python setup.py sdist bdist_wheel
|
|
- uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: |
|
|
python/dist/lancedb-*.tar.gz
|
|
python/dist/lancedb-*.whl
|
|
|
|
node:
|
|
runs-on: ubuntu-latest
|
|
needs: draft-release
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
working-directory: node
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 20
|
|
cache: 'npm'
|
|
cache-dependency-path: node/package-lock.json
|
|
- uses: Swatinem/rust-cache@v2
|
|
- 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:
|
|
files: node/vectordb-*.tgz
|
|
|
|
node-macos:
|
|
runs-on: macos-12
|
|
needs: draft-release
|
|
strategy:
|
|
matrix:
|
|
target: [x86_64-apple-darwin, aarch64-apple-darwin]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Install system dependencies
|
|
run: brew install protobuf
|
|
- name: Build MacOS native node modules
|
|
run: bash ci/build_macos_artifacts.sh ${{ matrix.target }}
|
|
- uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: node/dist/vectordb-darwin*.tgz
|
|
|
|
node-linux:
|
|
runs-on: ubuntu-latest
|
|
needs: draft-release
|
|
strategy:
|
|
matrix:
|
|
target:
|
|
- x86_64-unknown-linux-gnu:centos
|
|
- aarch64-unknown-linux-gnu:centos
|
|
- aarch64-unknown-linux-musl
|
|
- x86_64-unknown-linux-musl
|
|
steps:
|
|
- name: Install system dependencies
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y protobuf-compiler libssl-dev
|
|
- name: Build Linux native node modules
|
|
run: bash ci/build_linux_artifacts.sh ${{ matrix.target }}
|
|
- uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: node/dist/vectordb-linux*.tgz
|
|
|
|
release:
|
|
needs: [python, node, node-macos, node-linux]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/download-artifact@v3
|
|
- name: Publish to PyPI
|
|
env:
|
|
TWINE_USERNAME: __token__
|
|
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
|
|
run: |
|
|
python -m twine upload --non-interactive \
|
|
--skip-existing \
|
|
--repository testpypi python/dist/*
|
|
- name: Publish to NPM
|
|
run: |
|
|
for filename in node/dist/*.tgz; do
|
|
npm publish --dry-run $filename
|
|
done
|
|
- uses: softprops/action-gh-release@v1
|
|
with:
|
|
draft: false
|