Automate npm publishing for WordPress packages #37820
Replies: 12 comments 21 replies
-
Draft PR: #37751 |
Beta Was this translation helpful? Give feedback.
-
The current schedule for npm publishing looks as follows:
It would be great if we could develop a revised strategy where the "feature-freeze" mode in WordPress Core doesn't have any impact on when and how WordPress packages are published to npm. It might require a few changes in how we handle the dist-tags, but maybe we should exercise extreme cases to find something in the middle that works in most cases. The other issue discussed in #35630 is the lack of identifying npm releases tied to a specific WordPress major version or the Gutenberg plugin version. It would be beneficial for plugin authors to be able to install npm packages pinned to those configurations when willing to support ranges of plugins/WordPress core versions. At the moment, we don't even publish npm packages for every Gutenberg plugin release so we might want to address that as well. |
Beta Was this translation helpful? Give feedback.
-
For context, the existing script currently prompts the user to do so manually after it finishes: gutenberg/bin/plugin/commands/packages.js Lines 418 to 424 in 29ec9e0 I think that this part is the easiest to automate; we already have precedent in the build-plugin workflow: gutenberg/.github/workflows/build-plugin-zip.yml Lines 141 to 151 in 29ec9e0 The main task here will be to figure out the correct SHA(s) produced by |
Beta Was this translation helpful? Give feedback.
-
As for the ones that are part of the |
Beta Was this translation helpful? Give feedback.
-
I'm leaning towards changing the workflow trigger from manual (which I've currently put for testing purposes in #37751) to maybe upon release (which is also the trigger for the "Update Changelog and upload Gutenberg plugin to WordPress.org plugin repo" workflow) -- and limit it to publishing RC1, to replicate our currently documented recommendation. |
Beta Was this translation helpful? Give feedback.
-
This might be the trickiest one, especially in a lerna context. I'm hoping that we'll be able to find a solution that works by "just" storing some kind of token in GH Secrets. |
Beta Was this translation helpful? Give feedback.
-
Yeah, we can try to figure out something like that. OTOH, as a first step for automation, I like to replicate the exact behavior of the current script in CI, since there's always a bit of a risk of feature creep (especially if some changes need to be agreed upon -- easier to tackle those in follow-up PRs). Maybe there's some way to automatically determine (through some REST API maybe?) if WP Core is currently in feature-freeze mode. |
Beta Was this translation helpful? Give feedback.
-
This makes sense but could be a bit tricky to do, especially if we want our npm releases to follow semver. I think this is best discussed separately from the goal of automating the npm release process :) |
Beta Was this translation helpful? Give feedback.
-
I'm proposing a new strategy in #39259 where the "feature-freeze" mode in WordPress Core isn't taken into account when publishing npm packages with the |
Beta Was this translation helpful? Give feedback.
-
I was thinking about the changes to the publishing process based on the feedback in #39259 from @tellthemachines and this is my current thinking. Proposed revised strategy for npm publishingThe Gutenberg repository follows the WordPress SVN repository in the branching strategy for every major WordPress release. In addition to that, it also contains two other special branches that control npm publishing workflows:
Release types and their schedule:
|
Beta Was this translation helpful? Give feedback.
-
I opened #40927 which automates the process of publishing npm packages targeting the given major WordPress release. |
Beta Was this translation helpful? Give feedback.
-
The remaining tasks I can think of at the moment:
|
Beta Was this translation helpful? Give feedback.
-
We have GitHub automation in place for handling the Gutenberg plugin releases.
Prior work:
It would be great to bring the same experience when publishing WordPress packages to npm. It's still a partially manual process that has its quirks when the WordPress trunk branch can be closed or in "feature-freeze" mode as documented in Synchronizing WordPress Trunk.
Let's discuss:
trunk
or change the flow in a way where we could auto-approve all CLI prompts?Beta Was this translation helpful? Give feedback.
All reactions