diff --git a/bin/plugin/commands/packages.js b/bin/plugin/commands/packages.js index f0fa9f1c9e043a..525e91de084d1f 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.'