Add CI action to build python wheels for many platforms #18
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
fail-fast: false | |
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' | |
# fix 'error: library libintl.8.dylib not loaded' (see job #21559285751) | |
- run: | | |
brew install gettext | |
brew link gettext --force | |
if: matrix.os == 'macos-14' && (matrix.python-version == '3.8' || matrix.python-version == '3.9' || matrix.python-version == '3.10') | |
- 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@v5 | |
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 |