From da8555d258edbe676fa079fb51252f918ae032e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Zi=C3=B3=C5=82kowski?= Date: Mon, 1 Mar 2021 14:28:39 +0100 Subject: [PATCH] Packages: Update the publishing command for npm with next dist tag (#29379) --- bin/plugin/commands/packages.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/bin/plugin/commands/packages.js b/bin/plugin/commands/packages.js index f0fa9f1c9e043..525e91de084d1 100644 --- a/bin/plugin/commands/packages.js +++ b/bin/plugin/commands/packages.js @@ -275,14 +275,23 @@ async function publishPackagesToNpm( } ); if ( isPrerelease ) { - log( '>> Publishing modified packages to npm.' ); + log( + '>> Bumping version of public packages changed since the last release.' + ); + const { stdout: sha } = await command( 'git rev-parse --short HEAD' ); await command( - `npx lerna publish --canary ${ minimumVersionBump } --preid next`, + `npx lerna version pre${ minimumVersionBump } --preid next.${ sha } --no-private`, { cwd: gitWorkingDirectoryPath, stdio: 'inherit', } ); + + log( '>> Publishing modified packages to npm.' ); + await command( 'npx lerna publish from-package --dist-tag next', { + cwd: gitWorkingDirectoryPath, + stdio: 'inherit', + } ); } else { log( '>> Bumping version of public packages changed since the last release.'