-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Packages: Publishing to npm fails for wp/X.Y
branches because of older Node.js
#53628
Comments
An example of npm publishing failure is logged in: https://github.com/WordPress/gutenberg/actions/runs/5874702589/job/15929869480#step:8:409 |
Unfortunately, it isn't work as expected. I missed the important part that are taken care by the Node.js script we use for all types of publishing – switching to the correct branch in the |
I think I set back all correct versions of packages on npm dist-tag add @wordpress/wordcount@3.35.1 wp-6.3 --otp I generated them from const { dependencies } = require( './package.json' );
for ( const name in dependencies ) {
if ( ! name.startsWith( '@wordpress/' ) ) continue;
const { private, version } = require( `./packages/${ name.replace(
'@wordpress/',
''
) }/package.json` );
if ( private ) continue;
console.log(
`npm dist-tag add ${ name }@${ version } wp-6.3 --otp`
);
} I also included 2FA code, but I had to run these commands in batches because OTP codes expire quickly. |
I tested npm publishing with the following settings targeting WordPress 6.3: There were no changes to publish, but the job finished successfully performing all operations as designed: |
Description
Additional context in #53565. While trying to manually publish WordPress packages to npm using the script executed from the local machine, I run into an error where
npm ci
failed becausenpm
version set intrunk
to be able to run the script doesn't meet the requirements for the branch where source code lives. In effect, the script bails out, and publishing isn't possible.In effect, any backport to WordPress 6.3 and lower will fail from GitHub UI as explained:
https://github.com/WordPress/gutenberg/blob/trunk/docs/contributors/code/release.md#wordpress-releases
Everything should work correctly for WordPress 6.4, as the script and the future branch will use the same Node.js and npm versions.
Step-by-step reproduction instructions
I executed from
trunk
that is now on Node 16 and npm 8:It pulled changes from
release/16.4
that was still on Node 14 and npm 6, sonpm ci
throws an error that it can finish when using npm 8.The same issue will happen when trying to backport changes to WordPress core when using any of
wp/X.Y
branches that enforce usage of npm 6.Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: