Use cibuildwheel on Linux, disable Windows #11
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: Publish CLI wheels | |
on: | |
push: | |
# tags: | |
# - "v[0-9]+*" | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
env: | |
GH_TOKEN: ${{ github.token }} | |
jobs: | |
wheels-linux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: [x86_64] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
# WARNING: be careful with the ordering - the last version is the | |
# default one. Apparently maturin doesn't find all Python versions | |
# when one chooses a PyPy version instead of CPython as default | |
python-version: | | |
pypy3.8 | |
pypy3.9 | |
pypy3.10 | |
3.7 | |
3.8 | |
3.9 | |
3.11 | |
3.12 | |
3.10 | |
architecture: ${{ matrix.target }} | |
- name: Install build tools | |
run: | | |
pip install cibuildwheel | |
- name: Install non-Rust dependencies | |
run: | | |
python maintainer/install-lhapdf.py | |
- name: Build wheels | |
working-directory: pineappl_cli | |
run: | | |
cibuildwheel --out ../dist | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.job }}-${{ matrix.target }} | |
path: dist | |
wheels-macos: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
target: [aarch64, x86_64] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
# WARNING: be careful with the ordering - the last version is the | |
# default one. Apparently maturin doesn't find all Python versions | |
# when one chooses a PyPy version instead of CPython as default | |
python-version: | | |
pypy3.7 | |
pypy3.8 | |
pypy3.9 | |
pypy3.10 | |
3.7 | |
3.8 | |
3.9 | |
3.11 | |
3.12 | |
3.10 | |
- name: Install build tools | |
run: | | |
pip install maturin delocate | |
- name: Install non-Rust dependencies | |
run: | | |
python maintainer/install-lhapdf.py | |
- name: Build wheels | |
run: | | |
case ${{ matrix.target }} in | |
aarch64) | |
TARGET="aarch64-apple-darwin" | |
;; | |
x86_64) | |
TARGET="x86_64-apple-darwin" | |
;; | |
*) | |
exit 1 | |
esac | |
# `--find-interpreter` is needed to generate wheels for | |
# *all* Python versions | |
maturin build --release --out dist --find-interpreter \ | |
--target $TARGET --manifest-path pineappl_cli/Cargo.toml | |
- name: Patch wheels | |
run: | | |
delocate-wheel dist/* | |
python maintainer/patch-macos-wheel.py | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.job }}-${{ matrix.target }} | |
path: dist | |
wheels-windows: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
target: [x64] | |
if: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
# WARNING: be careful with the ordering - the last version is the | |
# default one. Apparently maturin doesn't find all Python versions | |
# when one chooses a PyPy version instead of CPython as default | |
python-version: | | |
pypy3.7 | |
pypy3.8 | |
pypy3.9 | |
pypy3.10 | |
3.7 | |
3.8 | |
3.9 | |
3.11 | |
3.12 | |
3.10 | |
architecture: ${{ matrix.target }} | |
- name: Install build tools | |
run: | | |
pip install maturin delvewheel | |
- name: Install non-Rust dependencies | |
run: | | |
python maintainer/install-lhapdf.py | |
- name: Build wheels | |
run: | | |
# `--find-interpreter` is needed to generate wheels for | |
# *all* Python versions | |
maturin build --release --out dist --find-interpreter \ | |
--manifest-path pineappl_cli/Cargo.toml | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.job }}-${{ matrix.target }} | |
path: dist |