Skip to content

Commit c742dca

Browse files
committed
For non-release CI, upload before validating
This allows downloading and poking at build artifacts that fail validation. Now the order of tasks for all platforms is the same: build, upload attestations, upload artifacts, validate. (This was already the order for macos.)
1 parent f4783d1 commit c742dca

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

.github/workflows/linux.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,19 @@ jobs:
249249
250250
./build-linux.py --target-triple ${{ matrix.target_triple }} --python cpython-${{ matrix.python }} --options ${{ matrix.build_options }}
251251
252+
- name: Generate attestations
253+
uses: actions/attest-build-provenance@v2
254+
if: ${{ github.ref == 'refs/heads/main' }}
255+
with:
256+
subject-path: dist/*
257+
258+
- name: Upload Distribution
259+
if: ${{ ! matrix.dry-run }}
260+
uses: actions/upload-artifact@v4
261+
with:
262+
name: cpython-${{ matrix.python }}-${{ matrix.target_triple }}-${{ matrix.build_options }}
263+
path: dist/*
264+
252265
- name: Validate Distribution
253266
if: ${{ ! matrix.dry-run }}
254267
run: |
@@ -267,19 +280,6 @@ jobs:
267280
268281
build/pythonbuild validate-distribution ${EXTRA_ARGS} dist/*.tar.zst
269282
270-
- name: Generate attestations
271-
uses: actions/attest-build-provenance@v2
272-
if: ${{ github.ref == 'refs/heads/main' }}
273-
with:
274-
subject-path: dist/*
275-
276-
- name: Upload Distribution
277-
if: ${{ ! matrix.dry-run }}
278-
uses: actions/upload-artifact@v4
279-
with:
280-
name: cpython-${{ matrix.python }}-${{ matrix.target_triple }}-${{ matrix.build_options }}
281-
path: dist/*
282-
283283
build-1:
284284
needs:
285285
- generate-matrix
@@ -349,6 +349,19 @@ jobs:
349349
350350
./build-linux.py --target-triple ${{ matrix.target_triple }} --python cpython-${{ matrix.python }} --options ${{ matrix.build_options }}
351351
352+
- name: Generate attestations
353+
uses: actions/attest-build-provenance@v2
354+
if: ${{ github.ref == 'refs/heads/main' }}
355+
with:
356+
subject-path: dist/*
357+
358+
- name: Upload Distribution
359+
if: ${{ ! matrix.dry-run }}
360+
uses: actions/upload-artifact@v4
361+
with:
362+
name: cpython-${{ matrix.python }}-${{ matrix.target_triple }}-${{ matrix.build_options }}
363+
path: dist/*
364+
352365
- name: Validate Distribution
353366
if: ${{ ! matrix.dry-run }}
354367
run: |
@@ -366,16 +379,3 @@ jobs:
366379
fi
367380
368381
build/pythonbuild validate-distribution ${EXTRA_ARGS} dist/*.tar.zst
369-
370-
- name: Generate attestations
371-
uses: actions/attest-build-provenance@v2
372-
if: ${{ github.ref == 'refs/heads/main' }}
373-
with:
374-
subject-path: dist/*
375-
376-
- name: Upload Distribution
377-
if: ${{ ! matrix.dry-run }}
378-
uses: actions/upload-artifact@v4
379-
with:
380-
name: cpython-${{ matrix.python }}-${{ matrix.target_triple }}-${{ matrix.build_options }}
381-
path: dist/*

.github/workflows/windows.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,6 @@ jobs:
146146
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\${{ matrix.vcvars }}"
147147
py.exe -3.12 build-windows.py --python cpython-${{ matrix.python }} --sh c:\cygwin\bin\sh.exe --options ${{ matrix.build_options }}
148148
149-
- name: Validate Distribution
150-
if: ${{ ! matrix.dry-run }}
151-
run: |
152-
$Dists = Resolve-Path -Path "dist/*.tar.zst" -Relative
153-
.\pythonbuild.exe validate-distribution --run $Dists
154-
155149
- name: Generate attestations
156150
uses: actions/attest-build-provenance@v2
157151
if: ${{ github.ref == 'refs/heads/main' }}
@@ -163,3 +157,9 @@ jobs:
163157
with:
164158
name: cpython-${{ matrix.python }}-${{ matrix.vcvars }}-${{ matrix.build_options }}
165159
path: dist/*
160+
161+
- name: Validate Distribution
162+
if: ${{ ! matrix.dry-run }}
163+
run: |
164+
$Dists = Resolve-Path -Path "dist/*.tar.zst" -Relative
165+
.\pythonbuild.exe validate-distribution --run $Dists

0 commit comments

Comments
 (0)