Skip to content

Commit a3cfb60

Browse files
committed
Bump actions/upload-artifact and download-artifact past retired v3
actions/upload-artifact@v3 is deprecated and now hard-fails every job immediately, breaking CI on every branch including master: https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/ Bumps to latest (upload-artifact@v7, download-artifact@v8) rather than the v4 minimum -- no breaking changes in between for this workflow's usage. v4+ requires a unique name per upload (v3 merged same-named artifacts silently), so each matrix leg and the sdist job upload under distinct names, reassembled on download via pattern/merge-multiple. Closes #82
1 parent ddd3a97 commit a3cfb60

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

.github/workflows/wheels.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,12 @@ jobs:
5252
CIBW_ARCHS: ${{ matrix.buildplat[2] }}
5353
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
5454

55-
- uses: actions/upload-artifact@v3
55+
- uses: actions/upload-artifact@v7
5656
with:
57+
# buildplat[1] alone isn't unique -- the matrix currently has duplicate
58+
# entries (see #80) -- so suffix with the job index to guarantee a
59+
# unique artifact name regardless.
60+
name: wheels-${{ matrix.buildplat[1] }}-${{ strategy.job-index }}
5761
path: ./wheelhouse/*.whl
5862

5963
build_sdist:
@@ -65,8 +69,9 @@ jobs:
6569
- name: Build sdist
6670
run: pipx run build --sdist
6771

68-
- uses: actions/upload-artifact@v3
72+
- uses: actions/upload-artifact@v7
6973
with:
74+
name: sdist
7075
path: dist/*.tar.gz
7176

7277
upload_pypi:
@@ -77,12 +82,13 @@ jobs:
7782
# alternatively, to publish when a GitHub Release is created, use the following rule:
7883
# if: github.event_name == 'release' && github.event.action == 'published'
7984
steps:
80-
- uses: actions/download-artifact@v3
85+
- uses: actions/download-artifact@v8
8186
with:
82-
# unpacks default artifact into dist/
83-
# if `name: artifact` is omitted, the action will create extra parent dir
84-
name: artifact
87+
# v4+ requires unique names per upload (unlike v3, which merged
88+
# same-named artifacts), so this flattens all of them into dist/
8589
path: dist
90+
pattern: "*"
91+
merge-multiple: true
8692

8793
- uses: pypa/gh-action-pypi-publish@v1.5.0
8894
with:

0 commit comments

Comments
 (0)