@@ -125,7 +125,8 @@ jobs:
125125 if : github.event.workflow_run.conclusion == 'success'
126126 timeout-minutes : 2 # 2025-11-20: Takes a few seconds.
127127 outputs :
128- zip_url : ${{ steps.run.outputs.zip_url }}
128+ artifact_name : ${{ steps.run.outputs.artifact_name }}
129+ artifact_filename : ${{ steps.run.outputs.artifact_filename }}
129130 any_plugins : ${{ steps.run.outputs.any_plugins }}
130131 steps :
131132 - uses : actions/checkout@v6
@@ -136,6 +137,8 @@ jobs:
136137 TOKEN : ${{ github.token }}
137138 URL : ${{ github.event.workflow_run.artifacts_url }}
138139 run : |
140+ ARTIFACT_NAME=
141+ ARTIFACT_FILENAME=
139142 for (( i=1; i<=5; i++ )); do
140143 [[ $i -gt 1 ]] && sleep 10
141144 echo "::group::Fetch list of artifacts (attempt $i/5)"
@@ -145,15 +148,25 @@ jobs:
145148 )"
146149 echo "$JSON"
147150 echo "::endgroup::"
148- ZIPURL="$(jq -r '.artifacts | map( select( .name == "jetpack-build" ) ) | sort_by( .created_at ) | last | .archive_download_url // empty' <<<"$JSON")"
151+
149152 PLUGINS="$(jq -r '.artifacts[] | select( .name == "plugins.tsv" )' <<<"$JSON")"
150- if [[ -n "$ZIPURL" ]]; then
153+
154+ # 2026-03-02: Temporarily look for both old and new artifacts.
155+ if jq -e '.artifacts | map( select( .name == "jetpack-build.tar.xz" ) )' <<<"$JSON" &>/dev/null; then
156+ ARTIFACT_NAME=jetpack-build.tar.xz
157+ ARTIFACT_FILENAME=jetpack-build.tar.xz
158+ break
159+ fi
160+ if jq -e '.artifacts | map( select( .name == "jetpack-build" ) )' <<<"$JSON" &>/dev/null; then
161+ ARTIFACT_NAME=jetpack-build
162+ ARTIFACT_FILENAME=build.tar.xz
151163 break
152164 fi
153165 done
154- [[ -z "$ZIPURL" ]] && { echo "::error::Failed to find artifact."; exit 1; }
155- echo "Zip URL: $ZIPURL"
156- echo "zip_url=${ZIPURL}" >> "$GITHUB_OUTPUT"
166+ [[ -z "$ARTIFACT_NAME" ]] && { echo "::error::Failed to find artifact."; exit 1; }
167+ echo "Artifact name: $ARTIFACT_NAME"
168+ echo "artifact_name=${ARTIFACT_NAME}" >> "$GITHUB_OUTPUT"
169+ echo "artifact_filename=${ARTIFACT_FILENAME}" >> "$GITHUB_OUTPUT"
157170 if [[ -z "$PLUGINS" ]]; then
158171 echo "Any plugins? No"
159172 echo "any_plugins=false" >> "$GITHUB_OUTPUT"
@@ -269,26 +282,17 @@ jobs:
269282 token : ${{ steps.get_token.outputs.token }}
270283
271284 - name : Download build artifact
285+ uses : actions/download-artifact@v8
286+ with :
287+ name : ${{ needs.find_artifact.outputs.artifact_name }}
288+ github-token : ${{ github.token }}
289+ run-id : ${{ github.event.workflow_run.id }}
290+
291+ - name : Extract build artifact
272292 env :
273- TOKEN : ${{ github.token }}
274- ZIPURL : ${{ needs.find_artifact.outputs.zip_url }}
293+ ARTIFACT_FILENAME : ${{ needs.find_artifact.outputs.artifact_filename }}
275294 shell : bash
276- run : |
277- for (( i=1; i<=2; i++ )); do
278- [[ $i -gt 1 ]] && sleep 10
279- echo "::group::Downloading artifact (attempt $i/2)"
280- curl -v -L --get \
281- --header "Authorization: token $TOKEN" \
282- --url "$ZIPURL" \
283- --output "artifact.zip"
284- echo "::endgroup::"
285- if [[ -e "artifact.zip" ]] && zipinfo artifact.zip &>/dev/null; then
286- break
287- fi
288- done
289- [[ ! -e "artifact.zip" ]] && { echo "::error::Failed to download artifact."; exit 1; }
290- unzip artifact.zip
291- tar --xz -xvvf build.tar.xz build/plugins.tsv
295+ run : tar --xz -xvvf "$ARTIFACT_FILENAME" build/plugins.tsv
292296
293297 - name : Prepare matrix
294298 id : matrix
@@ -345,26 +349,17 @@ jobs:
345349 path : commit
346350
347351 - name : Download build artifact
352+ uses : actions/download-artifact@v8
353+ with :
354+ name : ${{ needs.find_artifact.outputs.artifact_name }}
355+ github-token : ${{ github.token }}
356+ run-id : ${{ github.event.workflow_run.id }}
357+
358+ - name : Extract build artifact
348359 env :
349- TOKEN : ${{ github.token }}
350- ZIPURL : ${{ needs.find_artifact.outputs.zip_url }}
360+ ARTIFACT_FILENAME : ${{ needs.find_artifact.outputs.artifact_filename }}
351361 shell : bash
352- run : |
353- for (( i=1; i<=2; i++ )); do
354- [[ $i -gt 1 ]] && sleep 10
355- echo "::group::Downloading artifact (attempt $i/2)"
356- curl -v -L --get \
357- --header "Authorization: token $TOKEN" \
358- --url "$ZIPURL" \
359- --output "artifact.zip"
360- echo "::endgroup::"
361- if [[ -e "artifact.zip" ]] && zipinfo artifact.zip &>/dev/null; then
362- break
363- fi
364- done
365- [[ ! -e "artifact.zip" ]] && { echo "::error::Failed to download artifact."; exit 1; }
366- unzip artifact.zip
367- tar --xz -xvvf build.tar.xz build
362+ run : tar --xz -xvvf "$ARTIFACT_FILENAME" build
368363
369364 - name : Setup WordPress
370365 run : trunk/.github/files/test-plugin-update/setup.sh
@@ -442,26 +437,17 @@ jobs:
442437 token : ${{ steps.get_token.outputs.token }}
443438
444439 - name : Download build artifact
440+ uses : actions/download-artifact@v8
441+ with :
442+ name : ${{ needs.find_artifact.outputs.artifact_name }}
443+ github-token : ${{ github.token }}
444+ run-id : ${{ github.event.workflow_run.id }}
445+
446+ - name : Extract build artifact
445447 env :
446- TOKEN : ${{ github.token }}
447- ZIPURL : ${{ needs.find_artifact.outputs.zip_url }}
448+ ARTIFACT_FILENAME : ${{ needs.find_artifact.outputs.artifact_filename }}
448449 shell : bash
449- run : |
450- for (( i=1; i<=2; i++ )); do
451- [[ $i -gt 1 ]] && sleep 10
452- echo "::group::Downloading artifact (attempt $i/2)"
453- curl -v -L --get \
454- --header "Authorization: token $TOKEN" \
455- --url "$ZIPURL" \
456- --output "artifact.zip"
457- echo "::endgroup::"
458- if [[ -e "artifact.zip" ]] && zipinfo artifact.zip &>/dev/null; then
459- break
460- fi
461- done
462- [[ ! -e "artifact.zip" ]] && { echo "::error::Failed to download artifact."; exit 1; }
463- unzip artifact.zip
464- tar --xz -xvvf build.tar.xz build
450+ run : tar --xz -xvvf "$ARTIFACT_FILENAME" build
465451
466452 - name : Test filename restrictions
467453 id : tests
0 commit comments