Skip to content

SpatialQuery

SpatialQuery #8

Workflow file for this run

name: Build and publish wheels
on:
release:
types: [published]
# Allow manual trigger for testing
workflow_dispatch:
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: pypa/cibuildwheel@v2.22
env:
# Build for Python 3.10, 3.11, 3.12
CIBW_BUILD: "cp310-* cp311-* cp312-*"
# Skip 32-bit builds and musl linux
CIBW_SKIP: "*-manylinux_i686 *-musllinux*"
# macOS: build both Intel and Apple Silicon
CIBW_ARCHS_MACOS: "x86_64 arm64"
CIBW_ARCHS_LINUX: "x86_64"
# Use manylinux_2_28 so test deps (h5py, numba) have pre-built wheels
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28"
CIBW_BUILD_FRONTEND: "pip"
# Test the built wheel
CIBW_TEST_COMMAND: "python -c \"import SpatialQueryEliasFanoDB; print('C++ extension OK')\""
# Skip testing cross-compiled wheels (x86_64 on arm64 macOS runner)
CIBW_TEST_SKIP: "*-macosx_x86_64"
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install build
- run: python -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
publish:
name: Publish to PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
# Only publish on release events
if: github.event_name == 'release'
environment:
name: pypi
url: https://pypi.org/p/SpatialQuery
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
path: dist/
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1