Skip to content

Build Wheels (Linux v3) #5

Build Wheels (Linux v3)

Build Wheels (Linux v3) #5

Workflow file for this run

name: Build Wheels (Linux v3)
on:
workflow_dispatch:
inputs:
platform:
required: true
default: x86_64 i686 aarch64 ppc64le s390x armv7l
jobs:
define-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- run: python -m pip install -U pip wheel setuptools
- run: python -m pip install -U 'cibuildwheel==2.*'
- id: set-matrix
run: |
TARGETS="$(python -m cibuildwheel --archs "${{ github.event.inputs.platform }}" --print-build-identifiers)"
echo 'matrix=["'$(echo $TARGETS | sed -e 's/ /","/g')'"]' >> $GITHUB_OUTPUT
env:
CIBW_BUILD_FRONTEND: build
CIBW_SKIP: 'cp27-* pp*'
CIBW_DEPENDENCY_VERSIONS: pinned
CIBW_PLATFORM: linux
build:
runs-on: ubuntu-latest
needs:
- define-matrix
strategy:
matrix:
only: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Cache pip
uses: actions/cache@v4
with:
key: cache--${{ hashFiles('./requirements-dev.txt') }}
path: ~/.cache/pip
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- run: python -m pip install -U pip wheel setuptools
- run: python -m pip install -U 'cibuildwheel==2.*'
- run: python -m cibuildwheel --output-dir wheelhouse --only ${{ matrix.only }}
env:
CIBW_BUILD_FRONTEND: build
CIBW_SKIP: 'cp27-* pp*'
CIBW_DEPENDENCY_VERSIONS: pinned
CIBW_PLATFORM: linux
CIBW_TEST_COMMAND: python {project}/basic-sanity-test.py
CIBW_BEFORE_BUILD: |
python -m pip install -Ur requirements-dev.txt
make prepare
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.only }}
path: ./wheelhouse
retention-days: 1
combine:
runs-on: ubuntu-latest
needs:
- define-matrix
- build
steps:
- uses: actions/download-artifact@v4
with:
path: ./wheelhouse
- run: |
find -name '*.zip' -exec unzip '{}' ';'
find -name '*.zip' -exec rm '{}' +
find -name '*.whl' -exec mv -t. '{}' +
find -type d -delete
working-directory: ./wheelhouse
- uses: actions/upload-artifact@v4
with:
name: wheelhouse
path: ./wheelhouse