Skip to content

Commit

Permalink
Packages: Update the publishing command for npm with next dist tag (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo authored Mar 1, 2021
1 parent d3b7629 commit da8555d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions bin/plugin/commands/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
Expand Down

0 comments on commit da8555d

Please sign in to comment.