Skip to content

Add CI action to build python wheels for many platforms #15

Add CI action to build python wheels for many platforms

Add CI action to build python wheels for many platforms #15

Workflow file for this run

name: Build Python wheels
on:
push:
branches: [main]
tags: 'v*'
pull_request:
workflow_dispatch:
jobs:
build-python-wheels:
name: Build wheels on ${{ matrix.os }} with Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] # see https://devguide.python.org/versions/
steps:
- uses: actions/checkout@v4
- name: Set up rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- run: rustup target add aarch64-apple-darwin
if: matrix.os == 'macos-13' || matrix.os == 'macos-14'
- run: |
rustup toolchain install stable-i686-pc-windows-msvc
rustup target add i686-pc-windows-msvc
if: matrix.os == 'windows'
- name: Check Rust versions
run: |
rustc --version
which rustc
cargo --version
which cargo
rustup --version
which rustup
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install maturin
run: python -m pip install maturin
- name: Build wheels
run: |
cd lakers-python
maturin build --out wheelhouse
- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.os }}-python-${{ matrix.python-version }}
path: ./lakers-python/wheelhouse/*.whl