Skip to content

Commit

Permalink
Trying to build manylinux wheels using cibuildwheel
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenCzarnecki committed Oct 30, 2024
1 parent 1609ded commit 54842cb
Showing 1 changed file with 31 additions and 34 deletions.
65 changes: 31 additions & 34 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,50 +84,47 @@ jobs:
uses: actions/upload-artifact@v3
with:
path: ./dist/*.whl

build_wheels_manylinux_x86_64:
build_wheels_manylinux:
name: Build manylinux wheels
runs-on: ubuntu-24.04
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04]

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Need to use the image specified below to build manylinux wheels
# PyPi only accepts manylinux wheels, it does not accept wheels for specific versions/architectures
# Note that at least manylinux2014 is needed to get support for C++17
- name: Build manylinux Python wheels
uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_x86_64
with:
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312'
build-requirements: 'setuptools'

- name: upload wheels
uses: actions/upload-artifact@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
path: ./dist/*-manylinux*.whl
python-version: ${{ matrix.python-version }}

build_wheels_manylinux_arm64:
name: Build manylinux wheels (arm64)
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4

# Register QEMU for cross-architecture emulation
- name: Set up QEMU for cross-compilation
- name: Install QEMU for aarch64 emulation
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
platforms: all

# Build manylinux Python wheels for arm64 architecture
- name: Build manylinux Python wheels (arm64)
uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_aarch64
with:
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312'
build-requirements: 'setuptools'
- name: Install packages
run: |
pip install wheel
pip install setuptools
pip install build
pip install cibuildwheel
- name: Upload arm64 wheels
- name: build
run: cibuildwheel --platform linux
env:
CIBW_BUILD: cp3?-*
CIBW_ARCHS: x86_64 aarch64
CIBW_ENVIRONMENT: CXXFLAGS="-std=c++17"
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux2014"
CIBW_BEFORE_BUILD: |
yum install -y gcc gcc-c++
- name: upload wheels
uses: actions/upload-artifact@v3
with:
path: ./dist/*-manylinux*.whl
name: wheels-arm64
path: wheelhouse/*.whl

0 comments on commit 54842cb

Please sign in to comment.