Skip to content

Commit 4e60e2a

Browse files
committed
💅 Move whl name lookup to dedicated GHA job step
1 parent 2bea383 commit 4e60e2a

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

.github/workflows/ci.yaml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ jobs:
267267
if: ${{ ! contains(matrix.spec, 'x86_64') }}
268268

269269
- name: build/test wheels
270-
id: build
271270
env:
272271
CFLAGS: -Dffi_call=cffistatic_ffi_call # override name for ffi_call to break hard if we linked against someone else's libffi
273272
CIBW_ARCHS_LINUX: all
@@ -304,13 +303,18 @@ jobs:
304303
# actually build libffi + wheel (using env tweaks above)
305304
python -m cibuildwheel --output-dir dist ./cffi
306305
307-
echo "artifact_name=$(ls ./dist/)" >> "$GITHUB_OUTPUT"
306+
shell: bash
307+
308+
- name: determine built wheel filename
309+
id: built-artifact-lookup
310+
run: echo "artifact_name=$(ls ./dist/)" >> "${GITHUB_OUTPUT}"
311+
shell: bash -eEuxo pipefail {0}
308312

309313
- name: upload artifacts
310314
uses: actions/upload-artifact@v4
311315
with:
312-
name: ${{ steps.build.outputs.artifact_name }}
313-
path: dist/*.whl
316+
name: ${{ steps.built-artifact-lookup.outputs.artifact_name }}
317+
path: dist/${{ steps.built-artifact-lookup.outputs.artifact_name }}
314318
if-no-files-found: error
315319
if: ${{ env.skip_artifact_upload != 'true' }}
316320

@@ -406,7 +410,6 @@ jobs:
406410
brew uninstall --ignore-dependencies libffi 2>&1 || true
407411
408412
- name: build/test wheels
409-
id: build
410413
env:
411414
CIBW_BUILD: ${{ matrix.spec }}
412415
CIBW_PRERELEASE_PYTHONS: 'True'
@@ -422,14 +425,19 @@ jobs:
422425
tar zxf ${{ steps.fetch_sdist.outputs.download-path }}/cffi*.tar.gz/cffi*.tar.gz --strip-components=1 -C cffi
423426
424427
python3 -m cibuildwheel --output-dir dist cffi
425-
426-
echo "artifact_name=$(ls ./dist/)" >> "$GITHUB_OUTPUT"
428+
429+
shell: bash
430+
431+
- name: determine built wheel filename
432+
id: built-artifact-lookup
433+
run: echo "artifact_name=$(ls ./dist/)" >> "${GITHUB_OUTPUT}"
434+
shell: bash -eEuxo pipefail {0}
427435

428436
- name: upload artifacts
429437
uses: actions/upload-artifact@v4
430438
with:
431-
name: ${{ steps.build.outputs.artifact_name }}
432-
path: dist/*.whl
439+
name: ${{ steps.built-artifact-lookup.outputs.artifact_name }}
440+
path: dist/${{ steps.built-artifact-lookup.outputs.artifact_name }}
433441
if-no-files-found: error
434442
if: ${{ env.skip_artifact_upload != 'true' }}
435443

@@ -497,7 +505,6 @@ jobs:
497505
name: ${{ needs.python_sdist.outputs.artifact_name }}
498506

499507
- name: build/test wheels
500-
id: build
501508
env:
502509
CIBW_BUILD: ${{ matrix.spec }}
503510
CIBW_PRERELEASE_PYTHONS: 'True'
@@ -515,16 +522,19 @@ jobs:
515522
python -m pip install --upgrade pip
516523
pip install "${{ matrix.cibw_version || 'cibuildwheel'}}"
517524
python -m cibuildwheel --output-dir dist cffi
518-
519-
echo "artifact_name=$(ls ./dist/)" >> "$GITHUB_OUTPUT"
520525
521526
shell: bash
522527

528+
- name: determine built wheel filename
529+
id: built-artifact-lookup
530+
run: echo "artifact_name=$(ls ./dist/)" >> "${GITHUB_OUTPUT}"
531+
shell: bash -eEuxo pipefail {0}
532+
523533
- name: upload artifacts
524534
uses: actions/upload-artifact@v4
525535
with:
526-
name: ${{ steps.build.outputs.artifact_name }}
527-
path: dist/*.whl
536+
name: ${{ steps.built-artifact-lookup.outputs.artifact_name }}
537+
path: dist/${{ steps.built-artifact-lookup.outputs.artifact_name }}
528538
if-no-files-found: error
529539
if: ${{ env.skip_artifact_upload != 'true' }}
530540

0 commit comments

Comments
 (0)