29
29
jobs :
30
30
python_sdist :
31
31
runs-on : ubuntu-22.04
32
+ outputs :
33
+ sdist_artifact_name : ${{ steps.build_sdist.outputs.sdist_artifact_name }}
34
+ package_version : ${{ steps.build_sdist.outputs.package_version }}
32
35
steps :
33
36
- name : clone repo
34
37
uses : actions/checkout@v4
@@ -45,13 +48,14 @@ jobs:
45
48
python -m pip install build
46
49
python -m build --sdist
47
50
48
- echo "artifact_name=$(ls ./dist)" >> "$GITHUB_OUTPUT"
51
+ echo "sdist_artifact_name=$(ls ./dist)" >> "$GITHUB_OUTPUT"
52
+ echo "package_version=$(ls ./dist | sed -En 's/cffi-(.+)\.tar\.gz/\1/p')" >> "$GITHUB_OUTPUT"
49
53
50
54
- name : upload sdist artifact
51
55
uses : actions/upload-artifact@v4
52
56
with :
53
- name : ${{ steps.build_sdist.outputs.artifact_name }}
54
- path : dist/${{ steps.build_sdist.outputs.artifact_name }}
57
+ name : ${{ steps.build_sdist.outputs.sdist_artifact_name }}
58
+ path : dist/${{ steps.build_sdist.outputs.sdist_artifact_name }}
55
59
if-no-files-found : error
56
60
# always upload the sdist artifact- all the wheel build jobs require it
57
61
@@ -261,7 +265,7 @@ jobs:
261
265
id : fetch_sdist
262
266
uses : actions/download-artifact@v4
263
267
with :
264
- name : ${{ needs.build_sdist .outputs.artifact_name }}
268
+ name : ${{ needs.python_sdist .outputs.sdist_artifact_name }}
265
269
266
270
- name : configure docker foreign arch support
267
271
uses : docker/setup-qemu-action@v3
@@ -301,7 +305,7 @@ jobs:
301
305
302
306
mkdir cffi
303
307
304
- tar zxf ${{ steps.fetch_sdist.outputs.download-path }}/cffi*.tar.gz/cffi*.tar.gz --strip-components=1 -C cffi
308
+ tar zxf ${{ steps.fetch_sdist.outputs.download-path }}/cffi*.tar.gz --strip-components=1 -C cffi
305
309
python -m pip install --upgrade "${{ matrix.cibw_version || 'cibuildwheel' }}"
306
310
307
311
# actually build libffi + wheel (using env tweaks above)
@@ -394,7 +398,7 @@ jobs:
394
398
id : fetch_sdist
395
399
uses : actions/download-artifact@v4
396
400
with :
397
- name : ${{ needs.build_sdist .outputs.artifact_name }}
401
+ name : ${{ needs.python_sdist .outputs.sdist_artifact_name }}
398
402
399
403
- name : install python
400
404
uses : actions/setup-python@v5
@@ -422,7 +426,7 @@ jobs:
422
426
423
427
mkdir cffi
424
428
425
- tar zxf ${{ steps.fetch_sdist.outputs.download-path }}/cffi*.tar.gz/cffi*.tar.gz --strip-components=1 -C cffi
429
+ tar zxf ${{ steps.fetch_sdist.outputs.download-path }}/cffi*.tar.gz --strip-components=1 -C cffi
426
430
427
431
python3 -m cibuildwheel --output-dir dist cffi
428
432
@@ -497,7 +501,7 @@ jobs:
497
501
id : fetch_sdist
498
502
uses : actions/download-artifact@v4
499
503
with :
500
- name : ${{ needs.build_sdist .outputs.artifact_name }}
504
+ name : ${{ needs.python_sdist .outputs.sdist_artifact_name }}
501
505
502
506
- name : build/test wheels
503
507
id : build
@@ -513,7 +517,7 @@ jobs:
513
517
514
518
mkdir cffi
515
519
516
- tar zxf cffi*.tar.gz/cffi*.tar.gz --strip-components=1 -C cffi
520
+ tar zxf cffi*.tar.gz --strip-components=1 -C cffi
517
521
518
522
python -m pip install --upgrade pip
519
523
pip install "${{ matrix.cibw_version || 'cibuildwheel'}}"
@@ -538,7 +542,7 @@ jobs:
538
542
- name : merge all artifacts
539
543
uses : actions/upload-artifact/merge@v4
540
544
with :
541
- name : dist
545
+ name : dist-cffi-${{ needs.python_sdist.outputs.package_version }}
542
546
delete-merged : true
543
547
if : ${{ env.skip_artifact_upload != 'true' }}
544
548
0 commit comments