3232
3333jobs :
3434 prepare :
35- name : Run static analysis and prepare build
36- runs-on : ubuntu-latest
37-
38- outputs :
39- sdist-name : " ${{ steps.build-sdist.outputs.file-name }}"
40- latest-supported-python : " ${{ steps.latest-supported-python.outputs.version }}"
41-
42- steps :
43- - name : Checkout code
44- uses : actions/checkout@v5
45-
46- - name : Fetch release history
47- uses : ./.github/actions/fetch-release-history
48- with :
49- github-token : " ${{ github.token }}"
50-
51- - name : Load environment file
52- uses : ./.github/actions/load-env
53-
54- - name : Install Python
55- uses : actions/setup-python@v6
56- with :
57- python-version-file : pyproject.toml
58-
59- - name : Install uv
60- uses : astral-sh/setup-uv@v7
61-
62- - name : Install command runner
63- run : uv tool install rust-just
64-
65- - name : Install static analysis dependencies
66- run : just env-sync hooks
67-
68- - name : Run hooks
69- run : just hooks-check
70-
71- - name : Build source distribution
72- id : build-sdist
73- run : |-
74- uv build --sdist
75- sdist_name=$(basename dist/*.tar.gz)
76- echo "file-name=${sdist_name}" >> $GITHUB_OUTPUT
77-
78- - name : Upload artifact
79- uses : actions/upload-artifact@v5
80- with :
81- name : artifact-sdist
82- path : dist/${{ steps.build-sdist.outputs.file-name }}
83- if-no-files-found : error
84-
85- - name : Fetch latest supported Python
86- id : latest-supported-python
87- uses : ./.github/actions/latest-supported-python
88- with :
89- github-token : " ${{ github.token }}"
35+ name : Validate build
36+ uses : ./.github/workflows/prepare-build.yml
37+ with :
38+ run-static-analysis : true
39+ fetch-latest-python : true
9040
9141 test :
9242 name : Test Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
@@ -218,61 +168,14 @@ jobs:
218168 run : just test-typing
219169
220170 build-wheels :
221- name : Build wheels on ${{ matrix.os }} for ${{ matrix.archs }}
171+ name : Build wheels ${{ github.event_name == 'release' && ' for release' || '' }}
222172 needs :
223173 - test
224174 - prepare
225- runs-on : " ${{ matrix.os }}"
226- strategy :
227- fail-fast : false
228- matrix :
229- include :
230- - os : ubuntu-24.04-arm
231- archs : aarch64
232- - os : ubuntu-latest
233- archs : x86_64
234- - os : macos-latest
235- archs : arm64
236- - os : macos-15-intel
237- archs : x86_64
238- # - os: windows-11-arm
239- # archs: ARM64
240- - os : windows-latest
241- archs : AMD64
242-
243- env :
244- CIBW_SKIP : " ${{ github.event_name != 'release' && '*-musllinux_*' || '' }}"
245-
246- steps :
247- - name : Checkout code
248- uses : actions/checkout@v5
249-
250- - name : Download source distribution
251- uses : actions/download-artifact@v6
252- with :
253- name : artifact-sdist
254- path : dist
255-
256- # TODO: Remove this once the action supports specifying extras, see:
257- # https://github.com/pypa/cibuildwheel/pull/2630
258- - name : Install uv
259- if : runner.os != 'Linux'
260- uses : astral-sh/setup-uv@v7
261-
262- - name : Build & Test Wheels
263- uses : pypa/cibuildwheel@v3.2.1
264- with :
265- config-file : .cibuildwheel.toml
266- package-dir : dist/${{ needs.prepare.outputs.sdist-name }}
267- env :
268- CIBW_ARCHS : " ${{ matrix.archs }}"
269-
270- - name : Upload artifact
271- uses : actions/upload-artifact@v5
272- with :
273- name : artifact-wheels-${{ matrix.os }}-${{ matrix.archs }}
274- path : wheelhouse/*.whl
275- if-no-files-found : error
175+ uses : ./.github/workflows/build-wheels.yml
176+ with :
177+ sdist-name : " ${{ needs.prepare.outputs.sdist-name }}"
178+ build-all : ${{ github.event_name == 'release' }}
276179
277180 profile :
278181 name : Run profiling tests on Python ${{ needs.prepare.outputs.latest-supported-python }}
@@ -281,7 +184,6 @@ jobs:
281184 - build-wheels
282185 uses : ./.github/workflows/profile.yml
283186 with :
284- version : dev
285187 python : " ${{ needs.prepare.outputs.latest-supported-python }}"
286188
287189 upload-pypi :
0 commit comments