Automate WP npm publishing from GHCR builds - #79492
Closed
gigitux wants to merge 2 commits into
Closed
Conversation
gigitux
force-pushed
the
codex/automate-wp-npm-from-ghcr
branch
2 times, most recently
from
June 24, 2026 15:33
075c91a to
b218fc7
Compare
gigitux
force-pushed
the
codex/automate-wp-npm-from-ghcr
branch
from
June 24, 2026 15:34
b218fc7 to
cfa6f1f
Compare
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
Contributor
There was a problem hiding this comment.
Pull request overview
Automates the WordPress (wp/X.Y) npm publishing flow by chaining it from the existing Gutenberg plugin GHCR build pipeline, and adds safeguards to ensure the npm publish source matches the GHCR build’s recorded commit.
Changes:
- Add
workflow_callsupport topublish-npm-packages.yml, including awppublishing path that pulls thewp-X.YGHCR artifact and verifies.gutenberg-hashmatches the checked-outwp/X.Ybranch SHA before publishing. - Update
build-plugin-zip.ymlto call the npm publishing workflow after successfully publishing the mutablewp-X.YGHCR tag onwp/**branches.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| .github/workflows/publish-npm-packages.yml | Adds reusable workflow support and a GHCR-backed SHA verification gate for wp publishing. |
| .github/workflows/build-plugin-zip.yml | Triggers the wp npm publishing workflow after the GHCR publish job on wp/** branches. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Automates the
wp-X.Ynpm publishing path from the Gutenberg plugin build pipeline.When
build-plugin-zip.ymlsuccessfully publishes the mutable GHCR build tag for awp/X.Ybranch, it now calls the npm publishing workflow as a reusable workflow withrelease_type: wpand the branch ref aswp_version.The npm workflow now also supports
workflow_calland, for thewppath, verifies the source it is about to publish by:ghcr.io/wordpress/gutenberg/gutenberg-wp-develop-build:wp-X.Y.gutenberg-hashfrom the build artifactwp/X.Yto the npm dist-tag versionX.Ywp/X.Ybranch matches that SHAwp-X.Ydist-tagBackground
Historically, the WordPress release process had a more direct package-preparation path for the
@wordpress/*npm packages consumed by Core releases. That path is no longer prepared from the Gutenberg side in the same way, so thewp-X.Ynpm dist-tags can be left behind unless someone manually runs the npm publishing workflow.#78211 added a better source of truth for the build that WordPress consumes: Gutenberg now publishes a GHCR artifact with both an immutable SHA tag and a mutable stream tag such as
wp-7.0. The artifact also includes.gutenberg-hash, which records the exact Gutenberg commit used for that build.This PR connects that newer GHCR build signal to the existing npm publishing workflow. The GHCR
wp-X.Ytag remains the build pointer, and the npmwp-X.Ydist-tag is updated only after the workflow verifies that the checked-outwp/X.Ybranch matches the SHA recorded in the GHCR artifact.Why?
The GHCR build introduced in #78211 gives Gutenberg a mutable
wp-X.Yartifact that represents the build WordPress can consume. The npm package publishing flow still had to be triggered separately, sowp-7.0dist-tags could be missing even when the matching GHCR build existed.This connects the two steps while keeping the SHA verification explicit before npm publish mutates package dist-tags.
Testing Instructions
build-plugin-zip.ymland confirmtrigger-wp-npm-publishonly runs afterpublish-to-container-registrysucceeds onwp/**branches.publish-npm-packages.ymlstill supports manualworkflow_dispatch.wppath pulls the GHCRwp-X.Yartifact and verifies.gutenberg-hashbefore running Lerna.Checks run
YAML.load_file.git diff --check.Note: commit hooks were bypassed in the temporary clean worktree because Husky's generated helper was not installed there; the relevant checks above were run manually.