From 46853cf221941fd981d9f3383d9cde01f2d95117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= Date: Mon, 15 Jun 2020 16:21:19 +0200 Subject: [PATCH 1/5] Udpate docs for package release --- docs/contributors/release.md | 38 ++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/contributors/release.md b/docs/contributors/release.md index 3b791b13405704..0652ef06292c1c 100644 --- a/docs/contributors/release.md +++ b/docs/contributors/release.md @@ -166,7 +166,6 @@ Creating a release involves: 8. Push the tag `git push --tags`. 9. Merge the version bump pull request. - ##### Build the Plugin 1. Run `git fetch --tags`. @@ -228,38 +227,40 @@ If you don't have access to [make.wordpress.org/core](https://make.wordpress.org The Gutenberg repository mirrors the [WordPress SVN repository](https://make.wordpress.org/core/handbook/about/release-cycle/) in terms of branching for each SVN branch, a corresponding Gutenberg `wp/*` branch is created: - - The `wp/trunk` branch contains all the packages that are published and used in the `trunk` branch of WordPress. - - A Gutenberg branch targeting a specific WordPress major release (including its further minor increments) is created (example `wp/5.2`) based on the `wp/trunk` Gutenberg branch when the WordPress `trunk` branch is marked as "feature-freezed". (This usually happens when the first `beta` of the next WordPress major version is released). +- The `wp/trunk` branch contains all the packages that are published and used in the `trunk` branch of WordPress. +- A Gutenberg branch targeting a specific WordPress major release (including its further minor increments) is created (example `wp/5.2`) based on the `wp/trunk` Gutenberg branch when the WordPress `trunk` branch is marked as "feature-freezed". (This usually happens when the first `beta` of the next WordPress major version is released). ### Synchronizing WordPress Trunk -For each Gutenberg plugin release, WordPress trunk should be synchronized with this release. This involves the following steps that are automated with `./bin/plugin/cli npm-stable` command: +For each Gutenberg plugin release, WordPress trunk should be synchronized. Note that the WordPress `trunk` branch can be closed or in "feature-freeze" mode. Usually, this happens between the first `beta` and the first `RC` of the WordPress release cycle. During this period, the Gutenberg plugin releases should not be synchronized with WordPress Core. + +The process has three steps: 1) update the `wp/trunk` branch within the Gutenberg repo 2) publish the new package versions to npm 3) update the WordPress `trunk` branch. -**Note:** The WordPress `trunk` branch can be closed or in "feature-freeze" mode. Usually, this happens between the first `beta` and the first `RC` of the WordPress release cycle. During this period, the Gutenberg plugin releases should not be synchronized with WordPress Core. +The first step is automated via `./bin/plugin/cli.js npm-stable` command. You only have to run the command, but, for the record, the manual process would look like this: 1. Ensure the WordPress `trunk` branch is open for enhancements. 2. Get the last published Gutenberg release branch with `git fetch`. -2. Check out the `wp/trunk` branch. -3. Remove all files from the current branch: `git rm -r .`. -4. Check out all the files from the release branch: `git checkout release/x.x -- .`. -5. Commit all changes to the `wp/trunk` branch with `git commit -m "Merge changes published in the Gutenberg plugin vX.X release"` and push to the repository. -6. Update the `CHANGELOG.md` files of the packages with the new publish version calculated and commit to the `wp/trunk` branch. -Assuming the package versions are written using this format `major.minor.patch`, make sure to bump at least the `minor` version number. For example, if the CHANGELOG of the package to be released indicates that the next unreleased version is `5.6.1`, choose `5.7.0` as a version in case of `minor` version. +3. Check out the `wp/trunk` branch. +4. Remove all files from the current branch: `git rm -r .`. +5. Check out all the files from the release branch: `git checkout release/x.x -- .`. +6. Commit all changes to the `wp/trunk` branch with `git commit -m "Merge changes published in the Gutenberg plugin vX.X release"` and push to the repository. +7. Update the `CHANGELOG.md` files of the packages with the new publish version calculated and commit to the `wp/trunk` branch. Assuming the package versions are written using this format `major.minor.patch`, make sure to bump at least the `minor` version number. For example, if the CHANGELOG of the package to be released indicates that the next unreleased version is `5.6.1`, choose `5.7.0` as a version in case of `minor` version. -Now, the branch is ready to be used to publish the npm packages. +Once the command is finished, you can start the second part: publishing the npm packages. -1. Run the [package release process] but when asked for the version numbers to choose for each package pick values based on the updated CHANGELOG files. -2. Cherry-pick the "Publish" (created by Lerna) and the CHANGELOG update commits into the `master` branch of Gutenberg. - -Now, the npm packages should be ready and a patch can be created and committed into WordPress `trunk`. +1. Update your local `wp/trunk` branch with the latest changes pushed to GitHub. +2. Log-in to npm via the console: `npm login`. Note that you should have 2FA enabled. During the publish process it'll ask you what your One-Time Password is (this is the code from the authenticator app you use). +3. From the `wp/trunk` branch, run the script `npm run publish:prod`. When asked for the version numbers to choose for each package pick the values of the updated CHANGELOG files. +4. Cherry-pick the commits created by lerna ("Publish" and the CHANGELOG update) into the `master` branch of Gutenberg. +Finally, now that the npm packages are ready, a patch can be created and committed into WordPress `trunk`. ### Minor WordPress Releases The following workflow is needed when bug fixes or security releases need to be backported into WordPress Core. This can happen in a few use-cases: - - During the `beta` and the `RC` period of the WordPress release cycle. - - For WordPress minor releases and WordPress security releases (example `5.1.1`). +- During the `beta` and the `RC` period of the WordPress release cycle. +- For WordPress minor releases and WordPress security releases (example `5.1.1`). 1. Cherry-pick 2. Check out the last published Gutenberg release branch `git checkout release/x.x` @@ -278,7 +279,6 @@ Now, the branch is ready to be used to publish the npm packages. Now, the npm packages should be ready and a patch can be created and committed into the corresponding WordPress SVN branch. - ### Standalone Package Releases The following workflow is needed when packages require bug fixes or security releases to be published to _npm_ outside of a WordPress release cycle. From 79ac54140a741f53502ff949d7f39e43adeb3d94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= Date: Mon, 15 Jun 2020 16:25:35 +0200 Subject: [PATCH 2/5] Add note about use of OTP --- docs/contributors/release.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/contributors/release.md b/docs/contributors/release.md index 0652ef06292c1c..45e28bbc11c103 100644 --- a/docs/contributors/release.md +++ b/docs/contributors/release.md @@ -249,8 +249,10 @@ The first step is automated via `./bin/plugin/cli.js npm-stable` command. You on Once the command is finished, you can start the second part: publishing the npm packages. 1. Update your local `wp/trunk` branch with the latest changes pushed to GitHub. -2. Log-in to npm via the console: `npm login`. Note that you should have 2FA enabled. During the publish process it'll ask you what your One-Time Password is (this is the code from the authenticator app you use). -3. From the `wp/trunk` branch, run the script `npm run publish:prod`. When asked for the version numbers to choose for each package pick the values of the updated CHANGELOG files. +2. Log-in to npm via the console: `npm login`. Note that you should have 2FA enabled. +3. From the `wp/trunk` branch, run the script `npm run publish:prod`. + 1. When asked for the version numbers to choose for each package pick the values of the updated CHANGELOG files. + 2. You'll be asked for your One-Time Password (OTP) a couple of times. This is the code from the 2FA authenticator app you use. Depending on how many packages are to be released you may be asked for more than one OTP, as they tend to expire before all packages are released. 4. Cherry-pick the commits created by lerna ("Publish" and the CHANGELOG update) into the `master` branch of Gutenberg. Finally, now that the npm packages are ready, a patch can be created and committed into WordPress `trunk`. From 1805a5ae3e1995db20ba56731bb2a9d87831fb5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= Date: Mon, 15 Jun 2020 16:29:12 +0200 Subject: [PATCH 3/5] Add note about npm org --- docs/contributors/release.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contributors/release.md b/docs/contributors/release.md index 45e28bbc11c103..a9a04bf87f4054 100644 --- a/docs/contributors/release.md +++ b/docs/contributors/release.md @@ -2,7 +2,7 @@ This Repository is used to perform several types of releases. This document serves as a checklist for each one of these. It is helpful if you'd like to understand the different workflows. -To release Gutenberg, you need commit access to the [WordPress.org plugin repository][plugin repository]. 🙂 +To release Gutenberg, you need commit access to the [WordPress.org plugin repository][plugin repository] as well as being part of the [WordPress organization at npm](https://www.npmjs.com/org/wordpress). 🙂 ## Plugin Releases From 3708d9880fdad7bf830cec933c39ba6490cfa423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= Date: Mon, 15 Jun 2020 16:34:10 +0200 Subject: [PATCH 4/5] Add note about lerna publish from-package --- docs/contributors/release.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/contributors/release.md b/docs/contributors/release.md index a9a04bf87f4054..cace1a637cbd10 100644 --- a/docs/contributors/release.md +++ b/docs/contributors/release.md @@ -251,8 +251,9 @@ Once the command is finished, you can start the second part: publishing the npm 1. Update your local `wp/trunk` branch with the latest changes pushed to GitHub. 2. Log-in to npm via the console: `npm login`. Note that you should have 2FA enabled. 3. From the `wp/trunk` branch, run the script `npm run publish:prod`. - 1. When asked for the version numbers to choose for each package pick the values of the updated CHANGELOG files. - 2. You'll be asked for your One-Time Password (OTP) a couple of times. This is the code from the 2FA authenticator app you use. Depending on how many packages are to be released you may be asked for more than one OTP, as they tend to expire before all packages are released. + - When asked for the version numbers to choose for each package pick the values of the updated CHANGELOG files. + - You'll be asked for your One-Time Password (OTP) a couple of times. This is the code from the 2FA authenticator app you use. Depending on how many packages are to be released you may be asked for more than one OTP, as they tend to expire before all packages are released. + - If the publishing process ends up incomplete (perhaps because it timed-out or an bad OTP was introduce) you can resume it via `lerna publish from-packages`. 4. Cherry-pick the commits created by lerna ("Publish" and the CHANGELOG update) into the `master` branch of Gutenberg. Finally, now that the npm packages are ready, a patch can be created and committed into WordPress `trunk`. From be4816ccc6dd1cc651a8bcf57d33ef4ffe211cb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= Date: Mon, 15 Jun 2020 16:39:59 +0200 Subject: [PATCH 5/5] Update docs/contributors/release.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Greg Ziółkowski --- docs/contributors/release.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contributors/release.md b/docs/contributors/release.md index cace1a637cbd10..3fa3ce3577af89 100644 --- a/docs/contributors/release.md +++ b/docs/contributors/release.md @@ -253,7 +253,7 @@ Once the command is finished, you can start the second part: publishing the npm 3. From the `wp/trunk` branch, run the script `npm run publish:prod`. - When asked for the version numbers to choose for each package pick the values of the updated CHANGELOG files. - You'll be asked for your One-Time Password (OTP) a couple of times. This is the code from the 2FA authenticator app you use. Depending on how many packages are to be released you may be asked for more than one OTP, as they tend to expire before all packages are released. - - If the publishing process ends up incomplete (perhaps because it timed-out or an bad OTP was introduce) you can resume it via `lerna publish from-packages`. + - If the publishing process ends up incomplete (perhaps because it timed-out or an bad OTP was introduce) you can resume it via [`lerna publish from-package`](https://github.com/lerna/lerna/tree/master/commands/publish#bump-from-package). 4. Cherry-pick the commits created by lerna ("Publish" and the CHANGELOG update) into the `master` branch of Gutenberg. Finally, now that the npm packages are ready, a patch can be created and committed into WordPress `trunk`.