Skip to content

build-wheels

build-wheels #138

Workflow file for this run

name: build-wheels
on:
workflow_run:
workflows: ["run-tests"]
types:
- completed
branches: [main]
jobs:
build-macos-wheels:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: Build wheels on ${{ matrix.os }}-cp${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install "pybind11[global]"
pip install cibuildwheel
- name: Build wheels
run: |
PYTHON_VERSION=$(echo "${{ matrix.python }}" | tr -d '.')
export CIBW_BUILD="cp${PYTHON_VERSION}-*"
echo "CIBW_BUILD: $CIBW_BUILD"
python -m cibuildwheel
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_SKIP: "*-win32 *-manylinux_i686 pp*"
- name: Store the wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.python }}
path: ./wheelhouse/*.whl
compression-level: 0
- name: List uploaded artifacts
run: |
pwd
echo "Current directory contents:"
ls -R ./wheelhouse/
build-win-wheels:
name: Build wheels on ${{ matrix.os }}-cp${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install "pybind11[global]"
pip install cibuildwheel
- name: Build wheels
shell: pwsh
run: |
# Set Python version for CIBW_BUILD
$PYTHON_VERSION = "${{ matrix.python }}" -replace '\.'
$env:CIBW_BUILD = "cp${PYTHON_VERSION}-*"
Write-Host "CIBW_BUILD: $env:CIBW_BUILD"
python -m cibuildwheel
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_SKIP: "*-win32 *-manylinux* *-musllinux* pp*"
- name: Store the wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.python }}
path: .\wheelhouse\*.whl
compression-level: 0
- name: List uploaded artifacts
shell: pwsh
run: |
Write-Host "Current directory contents:"
Get-ChildItem -Recurse .\wheelhouse\
build-linux-wheels:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: Build wheels on manylinux_2_28_x86_64-cp${{ matrix.python }}
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.11"] # development python not supported
steps:
- uses: actions/checkout@v4
- name: Run tests in manylinux container
uses: addnab/docker-run-action@v3
with:
image: quay.io/pypa/manylinux_2_28_x86_64
options: -v ${{ github.workspace }}:/pyember
run: |
yum install -y python3-devel
yum install -y epel-release
yum install -y python3.11-devel
# Set python paths
PYTHON_VERSION=$(echo "${{ matrix.python }}" | tr -d '.')
PYSHORT="${{ matrix.python }}"
export PYROOT="/opt/python/cp${PYTHON_VERSION}-cp${PYTHON_VERSION}"
export PATH="${PYROOT}/bin:$PATH"
${PYROOT}/bin/python -m pip install --upgrade pip
export PYTHON_EXECUTABLE="${PYROOT}/bin/python"
export PYTHON_INCLUDE_DIR="${PYROOT}/include/python${PYSHORT}"
export Python_ROOT_DIR="${PYROOT}"
${PYROOT}/bin/pip install "pybind11[global]"
${PYROOT}/bin/pip install cibuildwheel
export CIBW_BUILD="cp${PYTHON_VERSION}-*"
cd /pyember
python -m cibuildwheel
- name: List uploaded artifacts
run: |
pwd
echo "Current directory contents:"
ls -R ./wheelhouse/