-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8365f4f
commit b76ffae
Showing
2 changed files
with
114 additions
and
23 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,92 @@ | ||
name: PyPI Publish | ||
name: Build and upload python wheels | ||
|
||
on: | ||
release: | ||
types: [ published ] | ||
types: [published] | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
# Only runs on tags that matches the python-make-release action | ||
if: startsWith(github.ref, 'refs/tags/python-v') | ||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: python | ||
linux: | ||
timeout-minutes: 60 | ||
strategy: | ||
matrix: | ||
python-minor-version: ["8"] | ||
platform: | ||
- x86_64 | ||
- aarch64 | ||
runs-on: "ubuntu-22.04" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
lfs: true | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.${{ matrix.python-minor-version }} | ||
- uses: ./.github/workflows/build_linux_wheel | ||
with: | ||
python-minor-version: ${{ matrix.python-minor-version }} | ||
args: "--release --strip" | ||
arm-build: ${{ matrix.platform == 'aarch64' }} | ||
- uses: ./.github/workflows/upload_wheel | ||
with: | ||
token: ${{ secrets.LANCEDB_PYPI_API_TOKEN }} | ||
repo: "pypi" | ||
mac: | ||
timeout-minutes: 60 | ||
runs-on: ${{ matrix.config.runner }} | ||
strategy: | ||
matrix: | ||
python-minor-version: ["8"] | ||
config: | ||
- target: x86_64-apple-darwin | ||
runner: macos-13 | ||
- target: aarch64-apple-darwin | ||
runner: macos-14 | ||
env: | ||
MACOSX_DEPLOYMENT_TARGET: 10.15 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref }} | ||
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: ${{ matrix.python-minor-version }} | ||
args: "--release --strip --target ${{ matrix.config.target }}" | ||
- uses: ./.github/workflows/upload_wheel | ||
with: | ||
python-minor-version: ${{ matrix.python-minor-version }} | ||
token: ${{ secrets.LANCEDB_PYPI_API_TOKEN }} | ||
repo: "pypi" | ||
windows: | ||
timeout-minutes: 60 | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
python-minor-version: ["8"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref }} | ||
fetch-depth: 0 | ||
lfs: true | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.8" | ||
- name: Build distribution | ||
run: | | ||
ls -la | ||
pip install wheel setuptools --upgrade | ||
python setup.py sdist bdist_wheel | ||
- name: Publish | ||
uses: pypa/gh-action-pypi-publish@v1.8.5 | ||
with: | ||
password: ${{ secrets.LANCEDB_PYPI_API_TOKEN }} | ||
packages-dir: python/dist | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.${{ matrix.python-minor-version }} | ||
- uses: ./.github/workflows/build_windows_wheel | ||
with: | ||
python-minor-version: ${{ matrix.python-minor-version }} | ||
args: "--release --strip" | ||
vcpkg_token: ${{ secrets.VCPKG_GITHUB_PACKAGES }} | ||
- uses: ./.github/workflows/upload_wheel | ||
with: | ||
python-minor-version: ${{ matrix.python-minor-version }} | ||
token: ${{ secrets.LANCEDB_PYPI_API_TOKEN }} | ||
repo: "pypi" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: upload-wheel | ||
|
||
description: "Upload wheels to Pypi" | ||
inputs: | ||
os: | ||
required: true | ||
description: "ubuntu-22.04 or macos-13" | ||
repo: | ||
required: false | ||
description: "pypi or testpypi" | ||
default: "pypi" | ||
token: | ||
required: true | ||
description: "release token for the repo" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install dependencies | ||
shell: bash | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install twine | ||
- name: Publish wheel | ||
working-directory: python | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ inputs.token }} | ||
shell: bash | ||
run: twine upload --repository ${{ inputs.repo }} target/wheels/lancedb-*.whl |