Files
lancedb/.github/workflows/release.yml
2023-05-23 17:14:58 -07:00

123 lines
3.2 KiB
YAML

name: Prepare Release
# Based on https://github.com/dherman/neon-prebuild-example/blob/eaa4d33d682e5eb7abbc3da7aed153a1b1acb1b3/.github/workflows/publish.yml
on:
push:
tags:
- v*
# TODO:
# Create draft relase
# Build and upload artifacts
# * Build wheel and sdist
# * Build npm module
# * Build native node modules
# Test release
# Publish release
env:
NODE_VERSION: 18.x
NPM_REGISTRY: 'https://registry.npmjs.org'
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
- 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: |
# yum install -y openssl-devel
# # protobuf is too old, so we directly download binaries
# PB_REL="https://github.com/protocolbuffers/protobuf/releases"
# PB_VERSION=23.1
# curl -LO $PB_REL/download/v$PB_VERSION/protoc-$PB_VERSION-linux-x86_64.zip
# unzip protoc-$PB_VERSION-linux-x86_64.zip -d $HOME/.local
# echo "${HOME}/.local/bin" >> $GITHUB_PATH