From 48ecaf45e197b25892e4138aa7a8724bfe00e5be Mon Sep 17 00:00:00 2001 From: Alban Diquet Date: Fri, 26 Nov 2021 17:56:24 -0800 Subject: [PATCH 1/2] Also build manylinux wheels for aarch64 --- .github/workflows/build_wheels.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 92f2540..1149496 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -40,6 +40,13 @@ jobs: - name: Install cibuildwheel run: python -m pip install "cibuildwheel>=2.22,<2.23" + # Needed for Linux aarch64 builds + - name: Set up QEMU + if: runner.os == 'Linux' + uses: docker/setup-qemu-action@v1 + with: + platforms: all + - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: @@ -48,8 +55,10 @@ jobs: # Build wheels for Apple x86_64 only; we use another workflow for Apple arm64 CIBW_ARCHS_MACOS: "native" # Build manylinux2014 wheels + CIBW_ARCHS_LINUX: auto aarch64 CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 CIBW_MANYLINUX_I686_IMAGE: manylinux2014 + CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014 # The C libraries (OpenSSL and Zlib) only need to be built once per OS # as they are not tied to a specific Python version CIBW_BEFORE_ALL: "python -m pip install setuptools invoke && invoke build.deps" From 5235bfbc0dd123450df7ac1807be747214823923 Mon Sep 17 00:00:00 2001 From: Alban Diquet Date: Thu, 26 Dec 2024 17:04:02 +0100 Subject: [PATCH 2/2] Split in 2 workflow to speed things up --- .github/workflows/build_wheels.yml | 9 ---- .../workflows/build_wheels_linux_aarch64.yml | 50 +++++++++++++++++++ 2 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/build_wheels_linux_aarch64.yml diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 1149496..92f2540 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -40,13 +40,6 @@ jobs: - name: Install cibuildwheel run: python -m pip install "cibuildwheel>=2.22,<2.23" - # Needed for Linux aarch64 builds - - name: Set up QEMU - if: runner.os == 'Linux' - uses: docker/setup-qemu-action@v1 - with: - platforms: all - - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: @@ -55,10 +48,8 @@ jobs: # Build wheels for Apple x86_64 only; we use another workflow for Apple arm64 CIBW_ARCHS_MACOS: "native" # Build manylinux2014 wheels - CIBW_ARCHS_LINUX: auto aarch64 CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 CIBW_MANYLINUX_I686_IMAGE: manylinux2014 - CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014 # The C libraries (OpenSSL and Zlib) only need to be built once per OS # as they are not tied to a specific Python version CIBW_BEFORE_ALL: "python -m pip install setuptools invoke && invoke build.deps" diff --git a/.github/workflows/build_wheels_linux_aarch64.yml b/.github/workflows/build_wheels_linux_aarch64.yml new file mode 100644 index 0000000..832c889 --- /dev/null +++ b/.github/workflows/build_wheels_linux_aarch64.yml @@ -0,0 +1,50 @@ +# Workflow just for linux aarch64 wheels so it can run in parallel with the build_wheels workflow +name: Build aarch64 Wheels + +on: + push: + branches: [ release ] + pull_request: + branches: [ release ] + +jobs: + build_wheels: + name: Build aarch64 wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-22.04] + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + name: Install Python + with: + python-version: '3.10' + + - name: Install cibuildwheel + run: python -m pip install "cibuildwheel>=2.22,<2.23" + + # Needed for Linux aarch64 builds + - name: Set up QEMU + if: runner.os == 'Linux' + uses: docker/setup-qemu-action@v1 + with: + platforms: all + + - name: Build wheels + run: python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-*" + CIBW_ARCHS_LINUX: aarch64 # Specifically build linux aarch64 wheels + CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014 + CIBW_BEFORE_ALL: "python -m pip install setuptools invoke && invoke build.deps" + CIBW_BEFORE_BUILD: "python -m pip install setuptools invoke && invoke build.nassl" + CIBW_TEST_REQUIRES: "pytest" + CIBW_TEST_COMMAND: "python -m pytest {project}/tests" + + - uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.os }}-wheels + path: ./wheelhouse/*.whl