Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-docker-monorepo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ jobs:
touch "$TEMP/digests/${DIGEST#sha256:}"

- name: Upload digest
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: digests-linux-${{ matrix.platform }}
path: ${{ runner.temp }}/digests/*
Expand All @@ -153,7 +153,7 @@ jobs:

steps:
- name: Download digests
uses: actions/download-artifact@v7
uses: actions/download-artifact@v8
with:
path: ${{ runner.temp }}/digests
pattern: digests-*
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
touch "$TEMP/digests/${DIGEST#sha256:}"

- name: Upload digest
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: digests-linux-${{ matrix.platform }}
path: ${{ runner.temp }}/digests/*
Expand All @@ -154,7 +154,7 @@ jobs:

steps:
- name: Download digests
uses: actions/download-artifact@v7
uses: actions/download-artifact@v8
with:
path: ${{ runner.temp }}/digests
pattern: digests-*
Expand Down
37 changes: 25 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,26 +146,39 @@ jobs:
# This is the official workaround: https://github.com/actions/upload-artifact#maintaining-file-permissions-and-case-sensitive-files
# It'll also make it faster to upload and download though, so maybe it's a win anyway.
- name: Create archive
run: tar --owner=0 --group=0 --xz -cvvf build.tar.xz -C "$BUILD_BASE" --transform 's,^\.,build,' .
run: |
tar --owner=0 --group=0 --xz -cvvf jetpack-build.tar.xz -C "$BUILD_BASE" --transform 's,^\.,build,' .
# For Store build as artifact (old)
ln jetpack-build.tar.xz build.tar.xz

- name: Store build as artifact
uses: actions/upload-artifact@v6
# 2026-03-02: Temporarily upload the artifact twice, under both old and new names, as we update things using the old name.
- name: Store build as artifact (old)
uses: actions/upload-artifact@v7
with:
name: jetpack-build
path: build.tar.xz
# Retain trunk builds for 7 days so we can manually download for branch comparisons. Branch builds only need one day so the beta builder can slurp it up to distribute.
retention-days: ${{ case( github.ref == 'refs/heads/trunk', 7, 1 ) }}
# Already compressed.
compression-level: 0
- name: Store build as artifact (new)
uses: actions/upload-artifact@v7
with:
path: jetpack-build.tar.xz
# Retain trunk builds for 7 days so we can manually download for branch comparisons. Branch builds only need one day so the beta builder can slurp it up to distribute.
retention-days: ${{ case( github.ref == 'refs/heads/trunk', 7, 1 ) }}
# Already compressed.
compression-level: 0
archive: false

- name: Store plugins.tsv as artifact
if: steps.plugins.outputs.any == 'true'
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: plugins.tsv
path: ${{ env.BUILD_BASE }}/plugins.tsv
# We don't really care about this artifact, its presence is a flag to the post-build job.
retention-days: 1
archive: false

- name: Update reminder with testing instructions
id: update-reminder-comment
Expand All @@ -191,11 +204,11 @@ jobs:
path: monorepo

- name: Download build artifact
uses: actions/download-artifact@v7
uses: actions/download-artifact@v8
with:
name: jetpack-build
name: jetpack-build.tar.xz
- name: Extract build archive
run: tar --xz -xvvf build.tar.xz build
run: tar --xz -xvvf jetpack-build.tar.xz build

- name: Prepare plugin zips
id: prepare
Expand Down Expand Up @@ -257,7 +270,7 @@ jobs:
echo "any-built=$ANY_BUILT" >> "$GITHUB_OUTPUT"

- name: Create plugins artifact
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
if: steps.prepare.outputs.any-built == 'true'
with:
name: plugins
Expand Down Expand Up @@ -288,12 +301,12 @@ jobs:
timeout-minutes: 1 # 2025-11-06: Successful runs seem to take a few seconds

- name: Download build artifact
uses: actions/download-artifact@v7
uses: actions/download-artifact@v8
with:
name: jetpack-build
name: jetpack-build.tar.xz
timeout-minutes: 2 # 2025-11-06: Successful runs normally take a few seconds
- name: Extract build archive
run: tar --xz -xvvf build.tar.xz build
run: tar --xz -xvvf jetpack-build.tar.xz build
timeout-minutes: 1 # 2025-11-06: Successful runs seem to take a few seconds

- name: Wait for prior instances of the workflow to finish
Expand Down
21 changes: 12 additions & 9 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ jobs:
COMPOSER_ROOT_VERSION: "dev-trunk"
BUILD_DIR: ./build-output
PROJECT_PATH: ${{ matrix.path }}
BUILD_GROUP: ${{ matrix.buildGroup }}
run: |
find . -path ./.github -prune -o -type f -print | sort > /tmp/before.txt
find . -path ./.github -prune -o -type l -print | sort > /tmp/beforel.txt
Expand Down Expand Up @@ -130,17 +131,17 @@ jobs:
echo "::endgroup::"

echo "::group::Creating artifact"
sed 's!^!./!' /tmp/changed.txt /tmp/changedl.txt | tar -cvvf build-cache.tar.xz --verbatim-files-from --files-from=-
sed 's!^!./!' /tmp/changed.txt /tmp/changedl.txt | tar -cvvf "$BUILD_GROUP.tar.xz" --verbatim-files-from --files-from=-
echo "::endgroup::"

- name: Save ${{ matrix.buildGroup }} build cache
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.buildGroup }}
path: build-cache.tar.xz
path: ${{ matrix.buildGroup }}.tar.xz
retention-days: 1
# Already compressed.
compression-level: 0
archive: false

e2e-tests:
name: "${{ matrix.project }} e2e tests"
Expand All @@ -162,14 +163,16 @@ jobs:
- uses: actions/checkout@v6

- name: Restore ${{ matrix.buildGroup }} build cache
uses: actions/download-artifact@v7
uses: actions/download-artifact@v8
if: needs.build-projects.result == 'success' && ! startsWith( matrix.suite, 'atomic' )
with:
name: ${{ matrix.buildGroup }}
name: ${{ matrix.buildGroup }}.tar.xz
- name: Extract ${{ matrix.buildGroup }} build cache
if: needs.build-projects.result == 'success' && ! startsWith( matrix.suite, 'atomic' )
env:
BUILD_GROUP: ${{ matrix.buildGroup }}
run: |
tar -xvvf build-cache.tar.xz .
tar -xvvf "$BUILD_GROUP.tar.xz" .

- name: Setup tools
uses: ./.github/actions/tool-setup
Expand Down Expand Up @@ -314,7 +317,7 @@ jobs:
- name: Upload test artifacts
if: ${{ always() }}
continue-on-error: true
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: test-output-${{ matrix.project }}
path: ${{ matrix.path }}/output
Expand Down Expand Up @@ -398,7 +401,7 @@ jobs:
working-directory: ./projects/github-actions/test-results-to-slack

- name: Download test artifacts
uses: actions/download-artifact@v7
uses: actions/download-artifact@v8
with:
path: test-output

Expand Down
106 changes: 46 additions & 60 deletions .github/workflows/post-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ jobs:
if: github.event.workflow_run.conclusion == 'success'
timeout-minutes: 2 # 2025-11-20: Takes a few seconds.
outputs:
zip_url: ${{ steps.run.outputs.zip_url }}
artifact_name: ${{ steps.run.outputs.artifact_name }}
artifact_filename: ${{ steps.run.outputs.artifact_filename }}
any_plugins: ${{ steps.run.outputs.any_plugins }}
steps:
- uses: actions/checkout@v6
Expand All @@ -136,6 +137,8 @@ jobs:
TOKEN: ${{ github.token }}
URL: ${{ github.event.workflow_run.artifacts_url }}
run: |
ARTIFACT_NAME=
ARTIFACT_FILENAME=
for (( i=1; i<=5; i++ )); do
[[ $i -gt 1 ]] && sleep 10
echo "::group::Fetch list of artifacts (attempt $i/5)"
Expand All @@ -145,15 +148,25 @@ jobs:
)"
echo "$JSON"
echo "::endgroup::"
ZIPURL="$(jq -r '.artifacts | map( select( .name == "jetpack-build" ) ) | sort_by( .created_at ) | last | .archive_download_url // empty' <<<"$JSON")"

PLUGINS="$(jq -r '.artifacts[] | select( .name == "plugins.tsv" )' <<<"$JSON")"
if [[ -n "$ZIPURL" ]]; then

# 2026-03-02: Temporarily look for both old and new artifacts.
if jq -e '.artifacts | map( select( .name == "jetpack-build.tar.xz" ) )' <<<"$JSON" &>/dev/null; then
ARTIFACT_NAME=jetpack-build.tar.xz
ARTIFACT_FILENAME=jetpack-build.tar.xz
break
fi
if jq -e '.artifacts | map( select( .name == "jetpack-build" ) )' <<<"$JSON" &>/dev/null; then
ARTIFACT_NAME=jetpack-build
ARTIFACT_FILENAME=build.tar.xz
break
fi
done
[[ -z "$ZIPURL" ]] && { echo "::error::Failed to find artifact."; exit 1; }
echo "Zip URL: $ZIPURL"
echo "zip_url=${ZIPURL}" >> "$GITHUB_OUTPUT"
[[ -z "$ARTIFACT_NAME" ]] && { echo "::error::Failed to find artifact."; exit 1; }
echo "Artifact name: $ARTIFACT_NAME"
echo "artifact_name=${ARTIFACT_NAME}" >> "$GITHUB_OUTPUT"
echo "artifact_filename=${ARTIFACT_FILENAME}" >> "$GITHUB_OUTPUT"
if [[ -z "$PLUGINS" ]]; then
echo "Any plugins? No"
echo "any_plugins=false" >> "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -269,26 +282,17 @@ jobs:
token: ${{ steps.get_token.outputs.token }}

- name: Download build artifact
uses: actions/download-artifact@v8
with:
name: ${{ needs.find_artifact.outputs.artifact_name }}
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}

- name: Extract build artifact
env:
TOKEN: ${{ github.token }}
ZIPURL: ${{ needs.find_artifact.outputs.zip_url }}
ARTIFACT_FILENAME: ${{ needs.find_artifact.outputs.artifact_filename }}
shell: bash
run: |
for (( i=1; i<=2; i++ )); do
[[ $i -gt 1 ]] && sleep 10
echo "::group::Downloading artifact (attempt $i/2)"
curl -v -L --get \
--header "Authorization: token $TOKEN" \
--url "$ZIPURL" \
--output "artifact.zip"
echo "::endgroup::"
if [[ -e "artifact.zip" ]] && zipinfo artifact.zip &>/dev/null; then
break
fi
done
[[ ! -e "artifact.zip" ]] && { echo "::error::Failed to download artifact."; exit 1; }
unzip artifact.zip
tar --xz -xvvf build.tar.xz build/plugins.tsv
run: tar --xz -xvvf "$ARTIFACT_FILENAME" build/plugins.tsv

- name: Prepare matrix
id: matrix
Expand Down Expand Up @@ -345,26 +349,17 @@ jobs:
path: commit

- name: Download build artifact
uses: actions/download-artifact@v8
with:
name: ${{ needs.find_artifact.outputs.artifact_name }}
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}

- name: Extract build artifact
env:
TOKEN: ${{ github.token }}
ZIPURL: ${{ needs.find_artifact.outputs.zip_url }}
ARTIFACT_FILENAME: ${{ needs.find_artifact.outputs.artifact_filename }}
shell: bash
run: |
for (( i=1; i<=2; i++ )); do
[[ $i -gt 1 ]] && sleep 10
echo "::group::Downloading artifact (attempt $i/2)"
curl -v -L --get \
--header "Authorization: token $TOKEN" \
--url "$ZIPURL" \
--output "artifact.zip"
echo "::endgroup::"
if [[ -e "artifact.zip" ]] && zipinfo artifact.zip &>/dev/null; then
break
fi
done
[[ ! -e "artifact.zip" ]] && { echo "::error::Failed to download artifact."; exit 1; }
unzip artifact.zip
tar --xz -xvvf build.tar.xz build
run: tar --xz -xvvf "$ARTIFACT_FILENAME" build

- name: Setup WordPress
run: trunk/.github/files/test-plugin-update/setup.sh
Expand Down Expand Up @@ -442,26 +437,17 @@ jobs:
token: ${{ steps.get_token.outputs.token }}

- name: Download build artifact
uses: actions/download-artifact@v8
with:
name: ${{ needs.find_artifact.outputs.artifact_name }}
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}

- name: Extract build artifact
env:
TOKEN: ${{ github.token }}
ZIPURL: ${{ needs.find_artifact.outputs.zip_url }}
ARTIFACT_FILENAME: ${{ needs.find_artifact.outputs.artifact_filename }}
shell: bash
run: |
for (( i=1; i<=2; i++ )); do
[[ $i -gt 1 ]] && sleep 10
echo "::group::Downloading artifact (attempt $i/2)"
curl -v -L --get \
--header "Authorization: token $TOKEN" \
--url "$ZIPURL" \
--output "artifact.zip"
echo "::endgroup::"
if [[ -e "artifact.zip" ]] && zipinfo artifact.zip &>/dev/null; then
break
fi
done
[[ ! -e "artifact.zip" ]] && { echo "::error::Failed to download artifact."; exit 1; }
unzip artifact.zip
tar --xz -xvvf build.tar.xz build
run: tar --xz -xvvf "$ARTIFACT_FILENAME" build

- name: Test filename restrictions
id: tests
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ jobs:
- name: Upload artifacts
id: upload-artifacts
if: always() && steps.check-artifacts.outputs.any == 'true'
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.artifact }}
path: artifacts
Expand Down Expand Up @@ -343,7 +343,7 @@ jobs:
uses: ./.github/actions/tool-setup

- name: Download coverage artifact
uses: actions/download-artifact@v7
uses: actions/download-artifact@v8
with:
name: 'Code coverage'
path: coverage
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/wpcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ jobs:
echo "::endgroup::"

- name: Store artifact
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: wpcomsh
path: wpcomsh.tar.xz
retention-days: 1
# Already compressed.
compression-level: 0
archive: false

deploy:
name: Run PHPUnit on the WP Cloud test site
Expand All @@ -81,9 +81,9 @@ jobs:
if: needs.build.outputs.wpcomsh == 'true'
steps:
- name: Download build artifact
uses: actions/download-artifact@v7
uses: actions/download-artifact@v8
with:
name: wpcomsh
name: wpcomsh.tar.xz

- name: Configure Github to be able to SSH to the WP Cloud site
run: |
Expand Down
Loading