Skip to content

Use latest stable version of nanobind #12

Use latest stable version of nanobind

Use latest stable version of nanobind #12

Workflow file for this run

name: Wheels
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
release:
types:
- published
env:
# Python 3.12+ is handled using the stable ABI, no need to build later versions
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8, <=3.12"
# Only build for PyPy 3.9
CIBW_SKIP: "pp37* pp38*"
# Target 64 bit architectures (x86_64, and arm64 on macOS)
CIBW_ARCHS_WINDOWS: auto64
CIBW_ARCHS_LINUX: auto64
CIBW_ARCHS_MACOS: x86_64 arm64
# Target older versions of macOS and Linux for good compatibility
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=10.14
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
# Necessary to see build output from the actual compilation
CIBW_BUILD_VERBOSITY: 1
# Temporary: use pre-release Python 3.12 for stable API builds
CIBW_PRERELEASE_PYTHONS: True
# GitHub Actions doesn't have macOS/arm64 runners, skip test on this platform
CIBW_TEST_SKIP: "*-macosx_arm64"
# make sure numpy is installed for the tests
CIBW_BEFORE_BUILD: pip install numpy
# Run pytest to ensure that the package was correctly built
CIBW_TEST_COMMAND: pytest {project}/tests
CIBW_TEST_REQUIRES: pytest
jobs:
build_sdist:
name: Build SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Build SDist
run: pipx run build --sdist
- name: Check metadata
run: pipx run twine check dist/*
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
build_wheels:
name: Wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: pypa/[email protected]
- name: Verify clean directory
run: git diff --exit-code
shell: bash
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
path: wheelhouse/*.whl
upload_all:
name: Upload if release
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/setup-python@v2
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@v1
with:
user: __token__
password: ${{ secrets.pypi_password }}