Add ability to pass specific dist tag to npm publish command from publishing flow

This commit is contained in:
fabioberger
2019-09-30 22:16:56 +08:00
parent d21f978def
commit 991cbc9f4e
2 changed files with 5 additions and 0 deletions

View File

@@ -252,6 +252,9 @@ async function lernaPublishAsync(packageToNextVersion: { [name: string]: string
lernaPublishArgs.push('--no-git-tag-version');
lernaPublishArgs.push('--no-push');
}
if (configs.DIST_TAG !== '') {
lernaPublishArgs.push(`--dist-tag ${configs.DIST_TAG}`);
}
utils.log('Lerna is publishing...');
try {
const child = spawn(lernaPublishCmd, lernaPublishArgs, {

View File

@@ -1,9 +1,11 @@
const IS_LOCAL_PUBLISH = process.env.IS_LOCAL_PUBLISH === 'true';
const DIST_TAG = process.env.DIST_TAG || '';
const LOCAL_NPM_REGISTRY_URL = 'http://localhost:4873';
const REMOTE_NPM_REGISTRY_URL = 'https://registry.npmjs.org/';
export const configs = {
IS_LOCAL_PUBLISH,
DIST_TAG,
NPM_REGISTRY_URL: IS_LOCAL_PUBLISH ? LOCAL_NPM_REGISTRY_URL : REMOTE_NPM_REGISTRY_URL,
DOCKER_HUB_ORG: '0xorg',
};