Skip to content

Build Python wheels #37

Build Python wheels

Build Python wheels #37

Workflow file for this run

name: Build Python wheels
on:
workflow_dispatch:
inputs:
upload:
description: 'Upload wheels to PyPI? (0: no, 1: yes)'
required: true
default: '0'
env:
CIBW_TEST_COMMAND: "python -c \"import drjit\""
CIBW_TEST_REQUIRES: ""
jobs:
build_wheels:
strategy:
matrix:
os: [ubuntu-20.04, windows-latest, macos-13, macos-14]
python: [cp38, cp39, cp310, cp311, cp312, cp313, cp313_stable]
exclude:
- os: macos-14
python: cp38
fail-fast: false
name: >

Check failure on line 25 in .github/workflows/wheels.yml

View workflow run for this annotation

GitHub Actions / Build Python wheels

Invalid workflow file

The workflow is not valid. .github/workflows/wheels.yml (Line: 25, Col: 11): Unexpected end of expression: ''''. Located at position 57 within expression: (startsWith(matrix.python, '_stable' && 'stable ABI' || ''
${{ matrix.python }} wheel for ${{ matrix.os }}
${{ (startsWith(matrix.python, '_stable' && 'stable ABI' || '' }}
runs-on: ${{ matrix.os }}
steps:
- uses: Wandalen/wretry.action@v1.2.0
with:
action: actions/checkout@v3
with: |
submodules: recursive
attempt_limit: 3
attempt_delay: 2000
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.10'
- name: Prepare compiler environment for Windows
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.20.0
- name: Build wheel
if: ${{ ! endsWith(matrix.python, '_stable') }}
env:
CIBW_BUILD: ${{ matrix.python }}-*
run: |
python -m cibuildwheel --output-dir wheelhouse
- name: Build stable ABI wheel (UNIX)
if: ${{ endsWith(matrix.python, '_stable') }} && runner.os != 'Windows'
run: |
stable_cp=$(echo ${{ matrix.python }} | cut -d_ -f1)
echo "CIBW_BUILD=$(stable_cp)" >> $GITHUB_ENV
echo "CIBW_CONFIG_SETTINGS=\"wheel.py-api=cp312 cmake.args=-DDRJIT_STABLE_ABI=ON\"" >> $GITHUB_ENV
python -m cibuildwheel --output-dir wheelhouse
- name: Build stable ABI wheel (Windows)
if: ${{ endsWith(matrix.python, '_stable') }} && runner.os == 'Windows'
run: |
stable_cp=$(echo ${{ matrix.python }} | cut -d_ -f1)
echo "CIBW_BUILD=$(stable_cp)" >> $GITHUB_ENV
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v3
with:
name: wheels
path: ./wheelhouse/*.whl
upload_pypi:
name: Upload wheels to PyPI
runs-on: ubuntu-latest
if: ${{ github.event.inputs.upload == '1'}}
needs: [build_wheels]
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
path: dist
- uses: pypa/gh-action-pypi-publish@v1.10.2
with:
user: __token__
repository-url: https://test.pypi.org/legacy/
password: ${{ secrets.PYPI_PASSWORD }}