Skip to content

pyKVFinder v0.9.0

pyKVFinder v0.9.0 #68

Workflow file for this run

name: Build and deploy
on:
release:
types: [published]
workflow_dispatch:
jobs:
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Build sdist
run: |
pipx run build --sdist
- name: Test sdist
run: |
pip install pytest
pip install dist/*.tar.gz
pytest tests/integration -v
- uses: actions/upload-artifact@v4
with:
name: artifacts-sdist
path: dist/*.tar.gz
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# macos-15: arm64, macos-15-intel: x64, macos-26: arm64+intel
os: [macos-15, macos-15-intel, macos-26, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v5
# Enable QEMU emulation for ARM
- name: Set up QEMU
if: matrix.os == 'ubuntu-latest'
uses: docker/setup-qemu-action@v3
with:
platforms: all
# Used to host cibuildwheel
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Set environment variable for macos-26 (arm64)
if: matrix.os == 'macos-26'
run: |
echo "MACOSX_DEPLOYMENT_TARGET=26.0" >> $GITHUB_ENV
echo "CC=$(brew --prefix llvm)/bin/clang" >> $GITHUB_ENV
- name: Set environment variable for macos-15 (arm64)
if: matrix.os == 'macos-15'
run: |
echo "MACOSX_DEPLOYMENT_TARGET=15.0" >> $GITHUB_ENV
echo "CC=$(brew --prefix llvm)/bin/clang" >> $GITHUB_ENV
- name: Set environment variable for macos-15-intel (intel)
if: matrix.os == 'macos-15-intel'
run: |
echo "MACOSX_DEPLOYMENT_TARGET=15.0" >> $GITHUB_ENV
echo "CC=$(brew --prefix llvm)/bin/clang" >> $GITHUB_ENV
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==3.3.0
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v4
with:
name: artifacts-${{ matrix.os }}
path: ./wheelhouse/*.whl
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
needs: [build_sdist, build_wheels]
environment:
name: pypi
url: https://pypi.org/p/pyKVFinder
permissions:
id-token: write
steps:
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: actions/download-artifact@v4
with:
path: ./dist
pattern: artifacts-*
merge-multiple: true
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}