Skip to content

Commit 22c70ef

Browse files
build(deps): upgrade actions/{upload,download}-artifact@v3 to v4 (#829)
* update actions/upload-artifact from v3 to v4 * update actions/download-artifact from v3 to v4 * build(dist): each build artifact gets a unique key and merged separately Uploads are now immutable for actions/upload-artifact@v4. This gives each build artifact a unique key, and then merges them together at the end. The [migration guide] suggests this pattern. [migration guide]: https://github.com/actions/upload-artifact/blob/main/docs/MIGRATION.md#merging-multiple-artifacts * use matrix.os to create unique upload key for build-python-mac-win job * use manylinux-x86_64 name for consistency with manylinux-aarch64
1 parent 02414d8 commit 22c70ef

File tree

2 files changed

+40
-21
lines changed

2 files changed

+40
-21
lines changed

.github/workflows/build.yml

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
override: true
5252
- name: Generate license file
5353
run: python ./dev/create_license.py
54-
- uses: actions/upload-artifact@v3
54+
- uses: actions/upload-artifact@v4
5555
with:
5656
name: python-wheel-license
5757
path: LICENSE.txt
@@ -84,7 +84,7 @@ jobs:
8484

8585
- run: rm LICENSE.txt
8686
- name: Download LICENSE.txt
87-
uses: actions/download-artifact@v3
87+
uses: actions/download-artifact@v4
8888
with:
8989
name: python-wheel-license
9090
path: .
@@ -110,9 +110,9 @@ jobs:
110110
run: find target/wheels/
111111

112112
- name: Archive wheels
113-
uses: actions/upload-artifact@v3
113+
uses: actions/upload-artifact@v4
114114
with:
115-
name: dist
115+
name: dist-${{ matrix.os }}
116116
path: target/wheels/*
117117

118118
build-macos-aarch64:
@@ -145,7 +145,7 @@ jobs:
145145

146146
- run: rm LICENSE.txt
147147
- name: Download LICENSE.txt
148-
uses: actions/download-artifact@v3
148+
uses: actions/download-artifact@v4
149149
with:
150150
name: python-wheel-license
151151
path: .
@@ -162,20 +162,20 @@ jobs:
162162
run: find target/wheels/
163163

164164
- name: Archive wheels
165-
uses: actions/upload-artifact@v3
165+
uses: actions/upload-artifact@v4
166166
with:
167-
name: dist
167+
name: dist-macos-aarch64
168168
path: target/wheels/*
169169

170-
build-manylinux:
170+
build-manylinux-x86_64:
171171
needs: [generate-license]
172172
name: Manylinux
173173
runs-on: ubuntu-latest
174174
steps:
175175
- uses: actions/checkout@v4
176176
- run: rm LICENSE.txt
177177
- name: Download LICENSE.txt
178-
uses: actions/download-artifact@v3
178+
uses: actions/download-artifact@v4
179179
with:
180180
name: python-wheel-license
181181
path: .
@@ -191,9 +191,9 @@ jobs:
191191
rustup-components: rust-std rustfmt # Keep them in one line due to https://github.com/PyO3/maturin-action/issues/153
192192
args: --release --manylinux 2014 --features protoc,substrait
193193
- name: Archive wheels
194-
uses: actions/upload-artifact@v3
194+
uses: actions/upload-artifact@v4
195195
with:
196-
name: dist
196+
name: dist-manylinux-x86_64
197197
path: target/wheels/*
198198

199199
build-manylinux-aarch64:
@@ -204,7 +204,7 @@ jobs:
204204
- uses: actions/checkout@v4
205205
- run: rm LICENSE.txt
206206
- name: Download LICENSE.txt
207-
uses: actions/download-artifact@v3
207+
uses: actions/download-artifact@v4
208208
with:
209209
name: python-wheel-license
210210
path: .
@@ -221,9 +221,9 @@ jobs:
221221
rustup-components: rust-std rustfmt # Keep them in one line due to https://github.com/PyO3/maturin-action/issues/153
222222
args: --release --features protoc,substrait
223223
- name: Archive wheels
224-
uses: actions/upload-artifact@v3
224+
uses: actions/upload-artifact@v4
225225
with:
226-
name: dist
226+
name: dist-manylinux-aarch64
227227
path: target/wheels/*
228228

229229
build-sdist:
@@ -234,7 +234,7 @@ jobs:
234234
- uses: actions/checkout@v4
235235
- run: rm LICENSE.txt
236236
- name: Download LICENSE.txt
237-
uses: actions/download-artifact@v3
237+
uses: actions/download-artifact@v4
238238
with:
239239
name: python-wheel-license
240240
path: .
@@ -246,19 +246,38 @@ jobs:
246246
manylinux: auto
247247
rustup-components: rust-std rustfmt
248248
args: --release --sdist --out dist --features protoc,substrait
249-
- name: Archive wheels
250-
uses: actions/upload-artifact@v3
249+
- name: Assert sdist build does not generate wheels
250+
run: |
251+
if [ "$(ls -A target/wheels)" ]; then
252+
echo "Error: Sdist build generated wheels"
253+
exit 1
254+
else
255+
echo "Directory is clean"
256+
fi
257+
shell: bash
258+
259+
merge-build-artifacts:
260+
runs-on: ubuntu-latest
261+
needs:
262+
- build-python-mac-win
263+
- build-macos-aarch64
264+
- build-manylinux-x86_64
265+
- build-manylinux-aarch64
266+
- build-sdist
267+
steps:
268+
- name: Merge Build Artifacts
269+
uses: actions/upload-artifact/merge@v4
251270
with:
252271
name: dist
253-
path: target/wheels/*
254-
272+
pattern: dist-*
273+
255274
# NOTE: PyPI publish needs to be done manually for now after release passed the vote
256275
# release:
257276
# name: Publish in PyPI
258277
# needs: [build-manylinux, build-python-mac-win]
259278
# runs-on: ubuntu-latest
260279
# steps:
261-
# - uses: actions/download-artifact@v3
280+
# - uses: actions/download-artifact@v4
262281
# - name: Publish to PyPI
263282
# uses: pypa/gh-action-pypi-publish@master
264283
# with:

.github/workflows/conda.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ jobs:
101101
run: |
102102
conda mambabuild --test packages/${{ matrix.arch }}/*.tar.bz2
103103
- name: Upload conda packages as artifacts
104-
uses: actions/upload-artifact@v3
104+
uses: actions/upload-artifact@v4
105105
with:
106106
name: "conda nightlies (python - ${{ matrix.python }}, arch - ${{ matrix.arch }})"
107107
# need to install all conda channel metadata to properly install locally

0 commit comments

Comments
 (0)