Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project management: Add prepublish packages command for npm releases #19214

Merged
merged 4 commits into from Dec 19, 2019

Conversation

@gziolo
Copy link
Member

gziolo commented Dec 18, 2019

Description

This PR adds a new command which handles prepublish to npm steps for a stable version of WordPress packages.

At the moment it only covers those steps which handle git management before Lerna takes over publishing to npm.

Check more details about the manual process in https://github.com/WordPress/gutenberg/blob/master/docs/contributors/release.md#synchronizing-wordpress-trunk.

How has this been tested?

./bin/commander.js prepublish-packages-stable

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR. .
@gziolo gziolo requested a review from youknowriad Dec 18, 2019
@gziolo gziolo requested review from ajitbohra, nerrad and ntwb as code owners Dec 18, 2019
@gziolo gziolo self-assigned this Dec 18, 2019
await runPushGitChangesStep( releaseBranch, abortMessage );

abortMessage = 'Aborting! The release is finished though.';
await runCleanLocalCloneStep( abortMessage );

This comment has been minimized.

Copy link
@gziolo

gziolo Dec 18, 2019

Author Member

This references svn folder which doesn’t exist in this context causing errors.

bin/commander.js Outdated Show resolved Hide resolved
Copy link
Contributor

youknowriad left a comment

I haven't tested, but it's looking good.

Good job.

gziolo and others added 2 commits Dec 19, 2019
Co-Authored-By: Riad Benguella <benguella@gmail.com>
svnWorkingDirectoryPath,
].map( async ( directoryPath ) => {
if ( fs.existsSync( directoryPath ) ) {
await rimraf( directoryPath, ( err ) => {

This comment has been minimized.

Copy link
@gziolo

gziolo Dec 19, 2019

Author Member

They do the same trick in rimraf in their bin implementation:
https://github.com/isaacs/rimraf/blob/d82bc81f251ba2cc86dc26361a820631091b3e9e/bin.js#L44-L48

This comment has been minimized.

Copy link
@gziolo

gziolo Dec 19, 2019

Author Member

It fixes the following error I observed locally:

The following error happened during the "Cleaning the temporary folder" step:
 AssertionError [ERR_ASSERTION]: rimraf: callback function required
    at rimraf (/Users/gziolo/PhpstormProjects/gutenberg/node_modules/rimraf/rimraf.js:52:10)
@gziolo

This comment has been minimized.

Copy link
Member Author

gziolo commented Dec 19, 2019

It was tested already on wp/trunk branch and everything worked properly, see:

94a0c81

@gziolo gziolo merged commit d3fcb4a into master Dec 19, 2019
1 of 2 checks passed
1 of 2 checks passed
pull-request-automation
Details
Travis CI - Pull Request Build Errored
Details
@gziolo gziolo deleted the update/publish-npm-packages branch Dec 19, 2019
@youknowriad youknowriad added this to the Gutenberg 7.2 milestone Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.