Wheel build #247
Workflow file for this run
This file contains hidden or 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: Wheel build | |
| on: | |
| release: | |
| types: [created] | |
| schedule: | |
| # ┌───────────── minute (0 - 59) | |
| # │ ┌───────────── hour (0 - 23) | |
| # │ │ ┌───────────── day of the month (1 - 31) | |
| # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) | |
| # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) | |
| # │ │ │ │ │ | |
| - cron: "42 3 * * 4" | |
| push: | |
| paths: | |
| - .github/workflows/wheels.yml | |
| - requirements.txt | |
| - pyproject.toml | |
| - MANIFEST.in | |
| - Makefile | |
| - setup* | |
| - build* | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| paths: | |
| - .github/workflows/wheels.yml | |
| - requirements.txt | |
| - pyproject.toml | |
| - MANIFEST.in | |
| - Makefile | |
| - setup* | |
| - build* | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| permissions: {} | |
| jobs: | |
| sdist: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out project | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Check out submodules | |
| run: git submodule update --init --recursive | |
| - name: Set up Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: "3.x" | |
| - name: Install Python dependencies | |
| run: python -m pip install -r requirements.txt | |
| - name: Build sdist | |
| run: make sdist | |
| - name: Upload sdist | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: sdist | |
| path: dist/*.tar.gz | |
| generate-wheels-matrix: | |
| # Create a matrix of all architectures & versions to build. | |
| # This enables the next step to run cibuildwheel in parallel. | |
| # From https://iscinumpy.dev/post/cibuildwheel-2-10-0/#only-210 | |
| name: Generate wheels matrix | |
| runs-on: ubuntu-latest | |
| outputs: | |
| include: ${{ steps.set-matrix.outputs.include }} | |
| steps: | |
| - name: Check out project | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Install cibuildwheel | |
| # Nb. keep cibuildwheel version pin consistent with job below | |
| run: pipx install cibuildwheel==3.4.1 | |
| - id: set-matrix | |
| run: | | |
| MATRIX=$( | |
| { | |
| cibuildwheel --print-build-identifiers --platform linux --archs "x86_64,aarch64" \ | |
| | grep -v musllinux \ | |
| | jq -nRc '{"only": inputs, "os": "ubuntu-latest"}' \ | |
| | sed -e '/aarch64/s|ubuntu-latest|ubuntu-24.04-arm|' \ | |
| && cibuildwheel --print-build-identifiers --platform macos --archs arm64 \ | |
| | jq -nRc '{"only": inputs, "os": "macos-latest"}' \ | |
| && cibuildwheel --print-build-identifiers --platform windows \ | |
| | jq -nRc '{"only": inputs, "os": "windows-latest"}' | |
| } | jq -sc | |
| ) | |
| echo "include=$MATRIX" | |
| echo "include=$MATRIX" >> $GITHUB_OUTPUT | |
| env: | |
| # Skip abi3 targets here: | |
| CIBW_SKIP: "cp31?-win_arm64 cp31?-win32" | |
| build_wheels: | |
| name: Build for ${{ matrix.only }} | |
| needs: generate-wheels-matrix | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: ${{ fromJson(needs.generate-wheels-matrix.outputs.include) }} | |
| env: | |
| MACOSX_DEPLOYMENT_TARGET: '11.0' | |
| LUPA_WITH_LUA_DLOPEN: ${{ startsWith(matrix.os, 'windows') && 'false' || 'true' }} | |
| LUPA_NO_LUAJIT: ${{ contains(matrix.only, 'win_arm64') && 'true' || 'false' }} | |
| steps: | |
| - name: Check out project | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Check out submodules | |
| run: git submodule update --init --recursive | |
| - name: Set up QEMU | |
| if: runner.os == 'Linux' | |
| uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0 | |
| with: | |
| platforms: all | |
| - name: Install MacOS dependencies | |
| if: runner.os == 'macOS' | |
| run: | | |
| brew install automake libtool | |
| ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize | |
| - name: Setup Visual Studio | |
| if: contains(matrix.os, 'windows') | |
| uses: TheMrMilchmann/setup-msvc-dev@79dac248aac9d0059f86eae9d8b5bfab4e95e97c # v4.0.0 | |
| with: | |
| arch: ${{ contains(matrix.only, 'win_amd64') && 'x64' || contains(matrix.only, 'win32') && 'x86' || contains(matrix.only, 'arm') && 'arm64' || '' }} | |
| - name: Fix link in Windows | |
| if: contains(matrix.os, 'windows') | |
| # Prevent 'link' from being found before 'link.exe' | |
| shell: bash | |
| run: rm -f /usr/bin/link | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1 | |
| with: | |
| only: ${{ matrix.only }} | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| path: ./wheelhouse/*.whl | |
| name: wheel-${{ matrix.only }} | |
| build_limited_api_wheels: | |
| name: Build ${{ matrix.target }} Stable ABI ${{ matrix.lapiversion }} wheels | |
| if: >- | |
| github.event_name == 'push' || | |
| github.event_name == 'release' || | |
| (github.event_name == 'schedule' && github.repository == 'cython/cython') || | |
| github.event_name == 'workflow_dispatch' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: | |
| # Smaller set of platforms that we only provide Stable ABI wheels for: | |
| - 'musllinux_x86_64' | |
| - 'musllinux_aarch64' | |
| - 'manylinux_i686' | |
| - 'musllinux_i686' | |
| - 'manylinux_ppc64le' | |
| - 'musllinux_ppc64le' | |
| - 'manylinux_riscv64' | |
| - 'musllinux_riscv64' | |
| - 'manylinux_armv7l' | |
| - 'musllinux_armv7l' | |
| - 'macosx_x86_64' | |
| - 'win32' | |
| - 'win_arm64' | |
| lapiversion: | |
| - "3.9" | |
| - "3.12" | |
| exclude: | |
| # Py3.9-abi3 on Windows lacks "PyThread" API. | |
| - target: 'win32' | |
| lapiversion: '3.9' | |
| - target: 'win_arm64' | |
| lapiversion: '3.9' | |
| include: | |
| - target: 'win32' | |
| lapiversion: '3.10' | |
| - target: 'win_arm64' | |
| lapiversion: '3.10' | |
| runs-on: ${{ | |
| contains(matrix.target, 'aarch64') && 'ubuntu-24.04-arm' || | |
| contains(matrix.target, 'armv7l') && 'ubuntu-24.04-arm' || | |
| contains(matrix.target, 'win_arm64') && 'windows-11-arm' || | |
| contains(matrix.target, 'win32') && 'windows-latest' || | |
| contains(matrix.target, 'macosx') && 'macos-latest' || | |
| 'ubuntu-latest' | |
| }} | |
| steps: | |
| - name: Check out project | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Check out submodules | |
| run: git submodule update --init --recursive | |
| - name: Set up Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: '3.x' | |
| - name: Set up QEMU | |
| if: runner.os == 'Linux' | |
| uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0 | |
| with: | |
| platforms: all | |
| - name: Install MacOS dependencies | |
| if: runner.os == 'macOS' | |
| run: | | |
| brew install automake libtool | |
| ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize | |
| - name: Setup Visual Studio on Windows | |
| if: startsWith(matrix.target, 'win') | |
| uses: TheMrMilchmann/setup-msvc-dev@79dac248aac9d0059f86eae9d8b5bfab4e95e97c # v4.0.0 | |
| with: | |
| arch: ${{ matrix.target == 'win32' && 'x86' || matrix.target == 'win_arm64' && 'arm64' || matrix.target == 'win_amd64' && 'amd64' || '' }} | |
| - name: Fix link in Windows | |
| if: startsWith(matrix.target, 'win') | |
| # Prevent 'link' from being found before 'link.exe' | |
| shell: bash | |
| run: rm -f /usr/bin/link | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1 | |
| env: | |
| CIBW_BUILD: "*${{ matrix.target }}" | |
| CIBW_SKIP: "cp31*t-* pp3*" | |
| CIBW_PROJECT_REQUIRES_PYTHON: ">=${{ matrix.lapiversion }}" | |
| LUPA_LIMITED_API: "${{ matrix.lapiversion }}" | |
| - name: Check wheel | |
| run: | | |
| python -m pip install twine | |
| python -m twine check ./wheelhouse/*.whl | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: Stable-ABI-${{ matrix.target }}-${{ matrix.lapiversion }} | |
| path: ./wheelhouse/*.whl | |
| upload_release_assets: | |
| name: Upload Release Wheels | |
| needs: [ sdist, build_wheels, build_limited_api_wheels, manylinux2014 ] | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags') | |
| permissions: | |
| contents: write # to create GitHub release (softprops/action-gh-release) | |
| steps: | |
| - name: Download bdist files | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| path: ./bdist_downloads | |
| merge-multiple: true | |
| - name: List downloaded artifacts | |
| run: ls -la ./bdist_downloads | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| path: ./bdist_downloads/*.whl | |
| name: wheels | |
| - name: Release | |
| uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1 | |
| with: | |
| files: | | |
| ./bdist_downloads/*.whl | |
| ./bdist_downloads/*.tar.gz | |
| manylinux2014: | |
| strategy: | |
| # Allows for matrix sub-jobs to fail without canceling the rest | |
| fail-fast: false | |
| matrix: | |
| image: | |
| - manylinux2014_x86_64 | |
| - manylinux2014_i686 | |
| pyversion: ["*"] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out project | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Check out submodules | |
| run: git submodule update --init --recursive | |
| - name: Set up Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: "3.x" | |
| - name: Install dependencies | |
| run: python -m pip install -r requirements.txt | |
| - name: Build Linux wheels | |
| run: make USE_BUNDLE=true sdist wheel_${{ matrix.image }} | |
| env: { PYTHON_BUILD_VERSION: "${{ matrix.pyversion }}" } | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: wheels-${{ matrix.image }} | |
| path: wheelhouse_*/*-m*linux*.whl # manylinux / musllinux | |
| if-no-files-found: ignore |