Skip to content

Commit 779e0b1

Browse files
committed
Maximize parallellization
1 parent 0f98dc0 commit 779e0b1

File tree

1 file changed

+34
-28
lines changed

1 file changed

+34
-28
lines changed

.github/workflows/release.yml

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ name: Release
22

33
on:
44
pull_request:
5-
branches:
6-
- "master"
7-
- "ci"
8-
- "[0-9]+.[0-9x]+*"
9-
paths:
10-
- "asyncpg/_version.py"
5+
# branches:
6+
# - "master"
7+
# - "ci"
8+
# - "[0-9]+.[0-9x]+*"
9+
# paths:
10+
# - "asyncpg/_version.py"
1111

1212
jobs:
1313
validate-release-request:
@@ -56,7 +56,7 @@ jobs:
5656
submodules: true
5757

5858
- name: Set up Python
59-
uses: actions/setup-python@v2
59+
uses: actions/setup-python@v4
6060

6161
- name: Build source distribution
6262
run: |
@@ -68,28 +68,35 @@ jobs:
6868
name: dist
6969
path: dist/*.tar.*
7070

71+
build-wheels-matrix:
72+
# needs: validate-release-request
73+
runs-on: ubuntu-latest
74+
outputs:
75+
include: ${{ steps.set-matrix.outputs.include }}
76+
steps:
77+
- uses: actions/checkout@v2
78+
- uses: actions/setup-python@v4
79+
- run: pip install https://github.com/henryiii/cibuildwheel/archive/refs/heads/henryiii/fix/crossplatform.zip # unreleased ref https://github.com/pypa/cibuildwheel/pull/1266
80+
- id: set-matrix
81+
run: |
82+
MATRIX_INCLUDE=$(
83+
{
84+
cibuildwheel --print-build-identifiers --platform linux --arch x86_64,aarch64 | grep cp | jq -Rc '{"only": inputs, "os": "ubuntu-latest"}' \
85+
&& cibuildwheel --print-build-identifiers --platform macos --arch x86_64,arm64 | grep cp | jq -Rc '{"only": inputs, "os": "macos-latest"}' \
86+
&& cibuildwheel --print-build-identifiers --platform windows --arch x86,AMD64 | grep cp | jq -Rc '{"only": inputs, "os": "windows-latest"}'
87+
} | jq -sc
88+
)
89+
echo ::set-output name=include::"$MATRIX_INCLUDE"
90+
7191
build-wheels:
72-
needs: validate-release-request
92+
needs: build-wheels-matrix
7393
runs-on: ${{ matrix.os }}
7494
continue-on-error: true
95+
name: Build ${{ matrix.only }}
96+
7597
strategy:
7698
matrix:
77-
include:
78-
- {os: macos-latest, arch: x86_64, build: "*"}
79-
- {os: macos-latest, arch: arm64, build: "*"}
80-
- {os: windows-latest, arch: AMD64, build: "*"}
81-
- {os: windows-latest, arch: x86, build: "*"}
82-
- {os: ubuntu-latest, arch: x86_64, build: "*"}
83-
- {os: ubuntu-latest, arch: aarch64, build: "*[61]-manylinux*"}
84-
- {os: ubuntu-latest, arch: aarch64, build: "*[72]-manylinux*"}
85-
- {os: ubuntu-latest, arch: aarch64, build: "*[83]-manylinux*"}
86-
- {os: ubuntu-latest, arch: aarch64, build: "*[94]-manylinux*"}
87-
- {os: ubuntu-latest, arch: aarch64, build: "*[05]-manylinux*"}
88-
- {os: ubuntu-latest, arch: aarch64, build: "*[61]-musllinux*"}
89-
- {os: ubuntu-latest, arch: aarch64, build: "*[72]-musllinux*"}
90-
- {os: ubuntu-latest, arch: aarch64, build: "*[83]-musllinux*"}
91-
- {os: ubuntu-latest, arch: aarch64, build: "*[94]-musllinux*"}
92-
- {os: ubuntu-latest, arch: aarch64, build: "*[05]-musllinux*"}
99+
include: ${{ fromJson(needs.build-wheels-matrix.outputs.include) }}
93100

94101
defaults:
95102
run:
@@ -109,11 +116,10 @@ jobs:
109116
uses: docker/setup-qemu-action@v2
110117

111118
- uses: pypa/cibuildwheel@v2.10.0
119+
with:
120+
only: ${{ matrix.only }}
112121
env:
113122
CIBW_BUILD_VERBOSITY: 1
114-
CIBW_ARCHS: ${{ matrix.arch }}
115-
CIBW_BUILD: ${{ matrix.build }} # py versions from setup.py -> python_requires
116-
CIBW_SKIP: pp*
117123
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
118124
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
119125

@@ -137,7 +143,7 @@ jobs:
137143
submodules: true
138144

139145
- name: Set up Python
140-
uses: actions/setup-python@v2
146+
uses: actions/setup-python@v4
141147
with:
142148
python-version: 3.8
143149

0 commit comments

Comments
 (0)