From 7b3c9285458183e5c56225294b761d35a7a37ce2 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Tue, 20 Sep 2022 19:38:20 +0200 Subject: [PATCH] Maximize parallellization --- .github/workflows/release.yml | 63 +++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 40f233f4..6b30750e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,12 +2,12 @@ name: Release on: pull_request: - branches: - - "master" - - "ci" - - "[0-9]+.[0-9x]+*" - paths: - - "asyncpg/_version.py" + # branches: + # - "master" + # - "ci" + # - "[0-9]+.[0-9x]+*" + # paths: + # - "asyncpg/_version.py" jobs: validate-release-request: @@ -56,7 +56,7 @@ jobs: submodules: true - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 - name: Build source distribution run: | @@ -68,28 +68,35 @@ jobs: name: dist path: dist/*.tar.* + build-wheels-matrix: + # needs: validate-release-request + runs-on: ubuntu-latest + outputs: + include: ${{ steps.set-matrix.outputs.include }} + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v4 + - run: pip install https://github.com/henryiii/cibuildwheel/archive/refs/heads/henryiii/fix/crossplatform.zip # unreleased ref https://github.com/pypa/cibuildwheel/pull/1266 + - id: set-matrix + run: | + MATRIX_INCLUDE=$( + { + cibuildwheel --print-build-identifiers --platform linux --arch x86_64,aarch64 | jq -Rc '{"only": inputs, "os": "ubuntu-latest"}' \ + && cibuildwheel --print-build-identifiers --platform macos --arch x86_64,arm64 | jq -Rc '{"only": inputs, "os": "macos-latest"}' \ + && cibuildwheel --print-build-identifiers --platform windows --arch x86,AMD64 | jq -Rc '{"only": inputs, "os": "windows-latest"}' + } | jq -sc + ) + echo ::set-output name=include::"$MATRIX_INCLUDE" + build-wheels: - needs: validate-release-request - runs-on: ${{ matrix.os }} + needs: build-wheels-matrix continue-on-error: true + name: Build ${{ matrix.only }} + runs-on: ${{ matrix.os }} + strategy: matrix: - include: - - {os: macos-latest, arch: x86_64, build: "*"} - - {os: macos-latest, arch: arm64, build: "*"} - - {os: windows-latest, arch: AMD64, build: "*"} - - {os: windows-latest, arch: x86, build: "*"} - - {os: ubuntu-latest, arch: x86_64, build: "*"} - - {os: ubuntu-latest, arch: aarch64, build: "*[61]-manylinux*"} - - {os: ubuntu-latest, arch: aarch64, build: "*[72]-manylinux*"} - - {os: ubuntu-latest, arch: aarch64, build: "*[83]-manylinux*"} - - {os: ubuntu-latest, arch: aarch64, build: "*[94]-manylinux*"} - - {os: ubuntu-latest, arch: aarch64, build: "*[05]-manylinux*"} - - {os: ubuntu-latest, arch: aarch64, build: "*[61]-musllinux*"} - - {os: ubuntu-latest, arch: aarch64, build: "*[72]-musllinux*"} - - {os: ubuntu-latest, arch: aarch64, build: "*[83]-musllinux*"} - - {os: ubuntu-latest, arch: aarch64, build: "*[94]-musllinux*"} - - {os: ubuntu-latest, arch: aarch64, build: "*[05]-musllinux*"} + include: ${{ fromJson(needs.build-wheels-matrix.outputs.include) }} defaults: run: @@ -109,10 +116,10 @@ jobs: uses: docker/setup-qemu-action@v2 - uses: pypa/cibuildwheel@v2.10.0 + with: + only: ${{ matrix.only }} env: CIBW_BUILD_VERBOSITY: 1 - CIBW_ARCHS: ${{ matrix.arch }} - CIBW_BUILD: ${{ matrix.build }} # py versions from setup.py -> python_requires CIBW_SKIP: pp* CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28 @@ -137,7 +144,7 @@ jobs: submodules: true - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.8