Update pyproject.toml and README.md #62
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: Build and Test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
release: | |
types: [created] | |
workflow_dispatch: | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: macos-13 | |
cibw-archs: x86_64 | |
deployment-target: '10.9' | |
- os: macos-latest | |
cibw-archs: arm64 | |
deployment-target: '11.0' | |
- os: ubuntu-latest | |
cibw-archs: x86_64 | |
deployment-target: '' | |
- os: ubuntu-arm64 | |
cibw-archs: aarch64 | |
deployment-target: '' | |
- os: windows-2022 | |
cibw-archs: 'AMD64 ARM64' | |
deployment-target: '' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
if: ${{ !startsWith(matrix.os, 'ubuntu') }} | |
with: | |
python-version: '3.11' | |
- uses: actions/setup-python@v4 | |
if: ${{ startsWith(matrix.os, 'ubuntu') }} | |
# for testing due to docker env issues | |
with: | |
python-version: '3.9' | |
- name: Install cibuildwheel | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade cibuildwheel | |
- name: Restore postgres build from cache | |
if: ${{ !startsWith(matrix.os, 'ubuntu') }} | |
id: restore-postgres | |
uses: actions/cache/restore@v3 | |
env: | |
cache-name: cache-postgres | |
with: | |
path: | | |
pgbuild | |
src/pixeltable_pgserver/pginstall | |
key: ${{ runner.os }}-${{ runner.arch }}-build-${{ env.cache-name }}-${{ | |
hashFiles('Makefile', 'pgbuild/Makefile', '.github/workflows/build-and-test.yml') }} | |
- name: Build postgres and pgvector | |
if: ${{ !startsWith(matrix.os, 'ubuntu') && !steps.restore-postgres.outputs.cache-hit }} | |
# Run `make` now so that we may cache the postgres build before running cibuildwheel | |
# (On Linux cibuildwheel runs in a docker container, so this won't work) | |
env: | |
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.deployment-target }} | |
run: make | |
- name: Save postgres build | |
if: ${{ !startsWith(matrix.os, 'ubuntu') && !steps.restore-postgres.outputs.cache-hit }} | |
id: cache-postgres | |
uses: actions/cache/save@v3 | |
env: | |
cache-name: cache-postgres | |
with: | |
path: | | |
pgbuild | |
src/pixeltable_pgserver/pginstall | |
key: ${{ runner.os }}-${{ runner.arch }}-build-${{ env.cache-name }}-${{ | |
hashFiles('Makefile', 'pgbuild/Makefile', '.github/workflows/build-and-test.yml') }} | |
- name: Build wheels | |
env: | |
CIBW_ARCHS: ${{ matrix.cibw-archs }} | |
CIBW_BUILD_VERBOSITY: 1 | |
CIBW_SKIP: pp* *-musllinux* | |
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.deployment-target }} | |
run: python -m cibuildwheel --output-dir wheelhouse | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: wheelhouse/*.whl | |
name: python-package-distributions | |
publish-to-pypi: | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
name: Publish Python dist to PyPI | |
needs: | |
- build_wheels | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/pixeltable-pgserver | |
permissions: | |
id-token: write # IMPORTANT: mandatory for trusted publishing | |
steps: | |
- name: Download all the dists | |
uses: actions/download-artifact@v3 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |