Skip to content

Improved CI

Improved CI #221

Workflow file for this run

name: Wheels
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build_sdist:
name: Build SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build SDist
run: pipx run build --sdist
- name: Check metadata
run: pipx run twine check dist/*
- uses: actions/upload-artifact@v4
with:
name: dist-sdist
path: dist/*.tar.gz
build_wheels:
name: Build wheels on ${{ matrix.os }}-${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-24.04, macos-15 ]
arch: [ x86_64 ]
include:
- os: ubuntu-24.04-arm
arch: aarch64
- os: macos-15
arch: arm64
- os: windows-2025
arch: amd64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.22.0
- name: Build wheels
# why do I need to specify this cpversion here?
env:
CIBW_ARCHS_MACOS: ${{ matrix.arch }}
OMPL_BUILD_ARCH: ${{ matrix.arch }}
# NOTE: Many combinations of OS, arch, and Python version can be built
# depending on your patience. For example:
CIBW_BUILD: cp3{10,11,12,13}-macosx_{x86_64,arm64} cp3{10,11,12,13}-manylinux_${{ matrix.arch }} cp3{10,11,12,13}-amd64
CIBW_BUILD_VERBOSITY: 1
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET="14.0"
# why isn't auto64 working?
CIBW_SKIP: "cp*-manylinux_i686 cp*-musllinux* cp*-win32"
run: python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
# Only run when a tag is pushed (adjust the condition as needed)
if: startsWith(github.ref, 'refs/tags/')
needs: build_sdist
steps:
- uses: actions/checkout@v4
- name: Download SDist artifact
uses: actions/download-artifact@v4
with:
name: dist-sdist
path: dist
- name: Install Twine
run: python -m pip install --upgrade twine
- name: Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: python -m twine upload --non-interactive dist/*