mirror of
https://github.com/lancedb/lancedb.git
synced 2026-01-06 20:02:58 +00:00
We have very low download stats for mac x86, and also latest github runners for mac are all arm, so it makes sense at this point to deprecate x86 support in general.
191 lines
6.3 KiB
YAML
191 lines
6.3 KiB
YAML
name: PyPI Publish
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'python-v*'
|
|
pull_request:
|
|
# This should trigger a dry run (we skip the final publish step)
|
|
paths:
|
|
- .github/workflows/pypi-publish.yml
|
|
- Cargo.toml # Change in dependency frequently breaks builds
|
|
|
|
env:
|
|
PIP_EXTRA_INDEX_URL: "https://pypi.fury.io/lance-format/ https://pypi.fury.io/lancedb/"
|
|
|
|
jobs:
|
|
linux:
|
|
name: Python ${{ matrix.config.platform }} manylinux${{ matrix.config.manylinux }}
|
|
timeout-minutes: 60
|
|
strategy:
|
|
matrix:
|
|
config:
|
|
- platform: x86_64
|
|
manylinux: "2_17"
|
|
extra_args: ""
|
|
runner: ubuntu-22.04
|
|
- platform: x86_64
|
|
manylinux: "2_28"
|
|
extra_args: "--features fp16kernels"
|
|
runner: ubuntu-22.04
|
|
- platform: aarch64
|
|
manylinux: "2_17"
|
|
extra_args: ""
|
|
# For successful fat LTO builds, we need a large runner to avoid OOM errors.
|
|
runner: ubuntu-2404-8x-arm64
|
|
- platform: aarch64
|
|
manylinux: "2_28"
|
|
extra_args: "--features fp16kernels"
|
|
runner: ubuntu-2404-8x-arm64
|
|
runs-on: ${{ matrix.config.runner }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
lfs: true
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.8
|
|
- uses: ./.github/workflows/build_linux_wheel
|
|
with:
|
|
python-minor-version: 8
|
|
args: "--release --strip ${{ matrix.config.extra_args }}"
|
|
arm-build: ${{ matrix.config.platform == 'aarch64' }}
|
|
manylinux: ${{ matrix.config.manylinux }}
|
|
- uses: ./.github/workflows/upload_wheel
|
|
if: startsWith(github.ref, 'refs/tags/python-v')
|
|
with:
|
|
pypi_token: ${{ secrets.LANCEDB_PYPI_API_TOKEN }}
|
|
fury_token: ${{ secrets.FURY_TOKEN }}
|
|
mac:
|
|
timeout-minutes: 90
|
|
runs-on: ${{ matrix.config.runner }}
|
|
strategy:
|
|
matrix:
|
|
config:
|
|
- target: aarch64-apple-darwin
|
|
runner: warp-macos-14-arm64-6x
|
|
env:
|
|
MACOSX_DEPLOYMENT_TARGET: 10.15
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
lfs: true
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.12
|
|
- uses: ./.github/workflows/build_mac_wheel
|
|
with:
|
|
python-minor-version: 8
|
|
args: "--release --strip --target ${{ matrix.config.target }} --features fp16kernels"
|
|
- uses: ./.github/workflows/upload_wheel
|
|
if: startsWith(github.ref, 'refs/tags/python-v')
|
|
with:
|
|
pypi_token: ${{ secrets.LANCEDB_PYPI_API_TOKEN }}
|
|
fury_token: ${{ secrets.FURY_TOKEN }}
|
|
windows:
|
|
timeout-minutes: 60
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
lfs: true
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.12
|
|
- uses: ./.github/workflows/build_windows_wheel
|
|
with:
|
|
python-minor-version: 8
|
|
args: "--release --strip"
|
|
vcpkg_token: ${{ secrets.VCPKG_GITHUB_PACKAGES }}
|
|
- uses: ./.github/workflows/upload_wheel
|
|
if: startsWith(github.ref, 'refs/tags/python-v')
|
|
with:
|
|
pypi_token: ${{ secrets.LANCEDB_PYPI_API_TOKEN }}
|
|
fury_token: ${{ secrets.FURY_TOKEN }}
|
|
gh-release:
|
|
if: startsWith(github.ref, 'refs/tags/python-v')
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
lfs: true
|
|
- name: Extract version
|
|
id: extract_version
|
|
env:
|
|
GITHUB_REF: ${{ github.ref }}
|
|
run: |
|
|
set -e
|
|
echo "Extracting tag and version from $GITHUB_REF"
|
|
if [[ $GITHUB_REF =~ refs/tags/python-v(.*) ]]; then
|
|
VERSION=${BASH_REMATCH[1]}
|
|
TAG=python-v$VERSION
|
|
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "Failed to extract version from $GITHUB_REF"
|
|
exit 1
|
|
fi
|
|
echo "Extracted version $VERSION from $GITHUB_REF"
|
|
if [[ $VERSION =~ beta ]]; then
|
|
echo "This is a beta release"
|
|
|
|
# Get last release (that is not this one)
|
|
FROM_TAG=$(git tag --sort='version:refname' \
|
|
| grep ^python-v \
|
|
| grep -vF "$TAG" \
|
|
| python ci/semver_sort.py python-v \
|
|
| tail -n 1)
|
|
else
|
|
echo "This is a stable release"
|
|
# Get last stable tag (ignore betas)
|
|
FROM_TAG=$(git tag --sort='version:refname' \
|
|
| grep ^python-v \
|
|
| grep -vF "$TAG" \
|
|
| grep -v beta \
|
|
| python ci/semver_sort.py python-v \
|
|
| tail -n 1)
|
|
fi
|
|
echo "Found from tag $FROM_TAG"
|
|
echo "from_tag=$FROM_TAG" >> $GITHUB_OUTPUT
|
|
- name: Create Python Release Notes
|
|
id: python_release_notes
|
|
uses: mikepenz/release-changelog-builder-action@v4
|
|
with:
|
|
configuration: .github/release_notes.json
|
|
toTag: ${{ steps.extract_version.outputs.tag }}
|
|
fromTag: ${{ steps.extract_version.outputs.from_tag }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Create Python GH release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
prerelease: ${{ contains('beta', github.ref) }}
|
|
tag_name: ${{ steps.extract_version.outputs.tag }}
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
generate_release_notes: false
|
|
name: Python LanceDB v${{ steps.extract_version.outputs.version }}
|
|
body: ${{ steps.python_release_notes.outputs.changelog }}
|
|
report-failure:
|
|
name: Report Workflow Failure
|
|
runs-on: ubuntu-latest
|
|
needs: [linux, mac, windows]
|
|
permissions:
|
|
contents: read
|
|
issues: write
|
|
if: always() && (github.event_name == 'release' || github.event_name == 'workflow_dispatch')
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./.github/actions/create-failure-issue
|
|
with:
|
|
job-results: ${{ toJSON(needs) }}
|
|
workflow-name: ${{ github.workflow }}
|