Fix doubly-zipped plugin artifacts in GitHub Actions#76857
Fix doubly-zipped plugin artifacts in GitHub Actions#76857
Conversation
Agent-Logs-Url: https://github.com/WordPress/gutenberg/sessions/b1b63c54-e526-4184-9511-64598f83e77a Co-authored-by: luisherranz <3305402+luisherranz@users.noreply.github.com>
| - name: Rename artifact for wordpress-develop build | ||
| if: ${{ ! matrix.IS_GUTENBERG_PLUGIN }} | ||
| run: mv gutenberg.zip gutenberg-wordpress-develop.zip | ||
|
|
||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | ||
| with: | ||
| name: gutenberg-${{ ! matrix.IS_GUTENBERG_PLUGIN && 'wordpress-develop' || 'plugin' }} | ||
| path: ./gutenberg.zip | ||
| # When archive is false, the file name is used as the artifact name. | ||
| # gutenberg.zip -> artifact "gutenberg.zip" (plugin build) | ||
| # gutenberg-wordpress-develop.zip -> artifact "gutenberg-wordpress-develop.zip" (WP develop build) | ||
| path: ${{ ! matrix.IS_GUTENBERG_PLUGIN && './gutenberg-wordpress-develop.zip' || './gutenberg.zip' }} | ||
| archive: false |
There was a problem hiding this comment.
@copilot, investigate and report what exactly is the zip for the WordPress develop build used for? Is it used in this repository, or in the wordpress-develop repository?
There was a problem hiding this comment.
The gutenberg-wordpress-develop.zip artifact is used only within this repository's workflow, as an internal intermediate step.
Here's the full flow:
- The
buildjob (withIS_GUTENBERG_PLUGIN: false) builds a WordPress-core-targeted version of the assets (withwpPlugin.name = "wp"andIS_WORDPRESS_CORE: true) and producesgutenberg.zip. - That ZIP is uploaded as the
gutenberg-wordpress-develop.zipartifact. - The
publish-to-container-registryjob (which also lives in this same workflow file) downloads that artifact, unzips it, re-compresses the files as a.tar.gz, and pushes the result to GitHub Container Registry atghcr.io/wordpress/gutenberg/gutenberg-wp-develop-build:<sha>.
The wordpress-develop repository doesn't consume the Actions artifact directly — it uses the GHCR tar.gz package produced in step 3. The ZIP artifact itself is never downloaded externally; it's purely an internal hand-off mechanism between the build job and the publish-to-container-registry job within this same workflow run.
There was a problem hiding this comment.
@copilot, are the changes in that part of the workflows absolutely necessary if that is internal? Can't this continue to function with a double zip as it has been working until now?
I'm only interested in the final gutenberg.zip.
There was a problem hiding this comment.
Good point — the wordpress-develop build side doesn't need the fix. Updated in c6dc156:
- The single shared upload step is now split into two conditional steps: the plugin build uses
archive: false, and the wordpress-develop build reverts to the originalname: gutenberg-wordpress-developbehavior (double-zip intact,publish-to-container-registryfully reverted). - The "Rename artifact" step is removed entirely.
- The only remaining change from the original is: plugin build uses
archive: false(fixing the double-zip for users) +create-releasedownloadsname: gutenberg.zip(the artifact name set byarchive: false).
…nal as-is Agent-Logs-Url: https://github.com/WordPress/gutenberg/sessions/d65f3bcc-6af7-46c5-ab37-83c5ebe9d094 Co-authored-by: luisherranz <3305402+luisherranz@users.noreply.github.com>
|
Flaky tests detected in c6dc156. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/23640506904
|
|
@copilot, the artifact name has changed from |
It's unavoidable when using
The only workaround is renaming the file before uploading — e.g. So the choices are:
Happy to implement whichever you prefer. If backward compatibility of the |
|
@copilot, please update the PR description to follow this repository's template, including the What, Why, and How sections. Also, add these two screenshots and testing instructions stating that to test this PR, one must download the artifact and attempt to install it. Before:
After:
|
Done — the PR description has been updated to follow the repository template with What, Why, How, Testing Instructions, and Screenshots sections, including the before/after screenshots in the standard table format. |
|
@youknowriad, @adamziel, what do you think? Is this worth it, or could it break unexpected integrations? |


What?
Fixes the double-zipping of the Gutenberg plugin artifact in GitHub Actions. When
gutenberg.zipwas uploaded, it got re-wrapped in another ZIP by the upload action, requiring users to unzip twice before they could install the plugin.Why?
GitHub Actions'
actions/upload-artifactautomatically archives uploaded files into a ZIP, so uploading an existing.zipresults in a double-zipped file. Users downloading the artifact from the workflow run page get a ZIP containing a ZIP, and attempting to install it directly in WordPress fails.actions/upload-artifact@v7.0.0(already pinned in this repo) introducedarchive: falseto upload a single file as-is, without re-wrapping it. This PR uses that option for the Gutenberg plugin build only.The wordpress-develop build artifact (
gutenberg-wordpress-develop) is only used internally — consumed by thepublish-to-container-registryjob in the same workflow, which unzips it and re-compresses to GHCR — so it continues to work with its existing behavior unchanged.How?
The single shared upload step in
build-plugin-zip.ymlis split into two conditional steps:IS_GUTENBERG_PLUGIN: true): Usesarchive: falseso the artifact is the rawgutenberg.zip, ready to install in WordPress. The artifact name becomesgutenberg.zip(thenameinput is ignored by the action whenarchive: false).IS_GUTENBERG_PLUGIN: false): Keeps the original behavior withname: gutenberg-wordpress-develop. No changes to thepublish-to-container-registryjob.The
create-releasejob is updated to download the artifact namedgutenberg.zip(previouslygutenberg-plugin).Note
The artifact name changes from
gutenberg-plugintogutenberg.zip. This is an unavoidable consequence of usingarchive: false— the action's documentation explicitly states thenameparameter is ignored in that mode and the filename is always used as the artifact name.Testing Instructions
Build Plugin ZIPworkflow on this branch (or wait for CI to run on this PR).gutenberg.zip.gutenberg.zip.Testing Instructions for Keyboard
N/A — this is a CI/workflow-only change with no UI impact.
Screenshots or screencast
Use of AI Tools
This PR was authored with GitHub Copilot (Coding Agent).
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.