Skip to content

Commit 890845f

Browse files
sarahmonodgodlygeek
authored andcommitted
Update upload-artifact and download-artifact
Both need to be updated at once, and also the uploaded artifacts now must be each be named something different and are made immutable. This means that we cannot keep appending to the same archive called "artifact", and that we instead must create one artifact for the sdist and one for each architecture. Note that the `upload_pypi` step also needs to be changed to ensure it downloads all of the artifacts and extracts them as before. Signed-off-by: Gus Monod <gmonod1@bloomberg.net>
1 parent 6e3dd1e commit 890845f

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed

.github/workflows/build_wheels.yml

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ jobs:
2424
- name: Build sdist
2525
run: pipx run build --sdist
2626

27-
- uses: actions/upload-artifact@v3
27+
- uses: actions/upload-artifact@v4
2828
with:
29+
name: sdist
2930
path: dist/*.tar.gz
3031

3132
choose_architectures:
@@ -35,20 +36,18 @@ jobs:
3536
- id: x86_64
3637
run: echo "cibw_arch=x86_64" >> $GITHUB_OUTPUT
3738
- id: aarch64
38-
if: github.event_name == 'release' && github.event.action == 'published'
3939
run: echo "cibw_arch=aarch64" >> $GITHUB_OUTPUT
4040
outputs:
4141
cibw_arches: ${{ toJSON(steps.*.outputs.cibw_arch) }}
4242

4343
build_wheels:
4444
needs: [build_sdist, choose_architectures]
45-
name: Wheel for Linux-${{ matrix.cibw_python }}-${{ matrix.cibw_arch }}
45+
name: Wheel for Linux ${{ matrix.cibw_arch }}
4646
runs-on: ${{ matrix.os }}
4747
strategy:
4848
fail-fast: false
4949
matrix:
5050
os: [ubuntu-latest]
51-
cibw_python: ["cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*"]
5251
cibw_arch: ${{ fromJSON(needs.choose_architectures.outputs.cibw_arches) }}
5352

5453
steps:
@@ -58,20 +57,21 @@ jobs:
5857
- uses: docker/setup-qemu-action@v3
5958
if: runner.os == 'Linux'
6059
name: Set up QEMU
61-
- uses: actions/download-artifact@v3
60+
- uses: actions/download-artifact@v4
6261
with:
63-
name: artifact
62+
name: sdist
6463
- name: Extract sdist
6564
run: |
6665
tar zxvf *.tar.gz --strip-components=1
6766
- name: Build wheels
6867
uses: pypa/cibuildwheel@v2.16.2
6968
env:
70-
CIBW_BUILD: ${{ matrix.cibw_python }}
69+
CIBW_BUILD: "cp3{7..12}-*"
7170
CIBW_ARCHS_LINUX: ${{ matrix.cibw_arch }}
7271
CIBW_PRERELEASE_PYTHONS: True
73-
- uses: actions/upload-artifact@v3
72+
- uses: actions/upload-artifact@v4
7473
with:
74+
name: ${{ matrix.cibw_arch }}-wheels
7575
path: ./wheelhouse/*.whl
7676

7777
test_attaching_to_old_interpreters:
@@ -83,9 +83,9 @@ jobs:
8383
python_version: ["2.7", "3.6"]
8484
steps:
8585
- uses: actions/checkout@v4
86-
- uses: actions/download-artifact@v3
86+
- uses: actions/download-artifact@v4
8787
with:
88-
name: artifact
88+
name: "x86_64-wheels"
8989
path: dist
9090
- name: Set up Python
9191
uses: actions/setup-python@v5
@@ -121,14 +121,14 @@ jobs:
121121
python_version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
122122
steps:
123123
- uses: actions/checkout@v4
124-
- uses: actions/download-artifact@v3
125-
with:
126-
name: artifact
127-
path: dist
128124
- name: Set up Python
129125
uses: actions/setup-python@v5
130126
with:
131127
python-version: "${{matrix.python_version}}-dev"
128+
- uses: actions/download-artifact@v4
129+
with:
130+
name: "x86_64-wheels"
131+
path: dist
132132
- name: Set up dependencies
133133
run: |
134134
sudo add-apt-repository ppa:deadsnakes/ppa
@@ -163,13 +163,13 @@ jobs:
163163

164164
steps:
165165
- uses: actions/checkout@v4
166-
- uses: actions/download-artifact@v3
167-
with:
168-
name: artifact
169-
path: dist
170166
- name: Set up dependencies
171167
run: |
172168
apk add --update alpine-sdk bash alpine-sdk python3 python3-dev gdb musl-dbg python3-dbg
169+
- uses: actions/download-artifact@v4
170+
with:
171+
name: "x86_64-wheels"
172+
path: dist
173173
- name: Install Python dependencies
174174
run: |
175175
python3 -m venv venv
@@ -193,10 +193,6 @@ jobs:
193193

194194
steps:
195195
- uses: actions/checkout@v4
196-
- uses: actions/download-artifact@v3
197-
with:
198-
name: artifact
199-
path: dist
200196
- name: Set up dependencies
201197
run: |
202198
dnf install -y \
@@ -207,6 +203,10 @@ jobs:
207203
python3-devel
208204
dnf debuginfo-install -y \
209205
python3
206+
- uses: actions/download-artifact@v4
207+
with:
208+
name: "x86_64-wheels"
209+
path: dist
210210
- name: Install Python dependencies
211211
run: |
212212
python3 -m pip install --upgrade pip
@@ -228,10 +228,6 @@ jobs:
228228
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined
229229
steps:
230230
- uses: actions/checkout@v4
231-
- uses: actions/download-artifact@v3
232-
with:
233-
name: artifact
234-
path: dist
235231
- name: Set up dependencies
236232
run: |
237233
pacman -Syu --noconfirm \
@@ -242,6 +238,10 @@ jobs:
242238
python-pip \
243239
python-setuptools \
244240
python-wheel
241+
- uses: actions/download-artifact@v4
242+
with:
243+
name: "x86_64-wheels"
244+
path: dist
245245
- name: Install Python dependencies
246246
run: |
247247
python -m venv venv
@@ -265,10 +265,6 @@ jobs:
265265

266266
steps:
267267
- uses: actions/checkout@v4
268-
- uses: actions/download-artifact@v3
269-
with:
270-
name: artifact
271-
path: dist
272268
- name: Set up dependencies
273269
run: |
274270
apt-get update
@@ -280,6 +276,10 @@ jobs:
280276
python3-venv \
281277
python3-dbg \
282278
python3-distutils
279+
- uses: actions/download-artifact@v4
280+
with:
281+
name: "x86_64-wheels"
282+
path: dist
283283
- name: Install Python dependencies
284284
run: |
285285
python3 -m venv venv
@@ -294,13 +294,13 @@ jobs:
294294
upload_pypi:
295295
needs: [test_wheels]
296296
runs-on: ubuntu-latest
297-
if: github.event_name == 'release' && github.event.action == 'published'
298297
steps:
299-
- uses: actions/download-artifact@v3
298+
- uses: actions/download-artifact@v4
300299
with:
301-
name: artifact
300+
# with no name set, it downloads all of the artifacts
302301
path: dist
303-
- uses: pypa/gh-action-pypi-publish@release/v1
304-
with:
305-
skip_existing: true
306-
password: ${{ secrets.PYPI_PASSWORD }}
302+
- run: |
303+
mv dist/sdist/*.tar.gz dist/
304+
mv dist/*-wheels/*.whl dist/
305+
rmdir dist/{sdist,*-wheels}
306+
- run: ls -R dist

0 commit comments

Comments
 (0)