diff options
Diffstat (limited to 'packages/monorepo-scripts/src/postpublish_utils.ts')
-rw-r--r-- | packages/monorepo-scripts/src/postpublish_utils.ts | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/packages/monorepo-scripts/src/postpublish_utils.ts b/packages/monorepo-scripts/src/postpublish_utils.ts index 8c9d95e44..229bb9031 100644 --- a/packages/monorepo-scripts/src/postpublish_utils.ts +++ b/packages/monorepo-scripts/src/postpublish_utils.ts @@ -25,6 +25,8 @@ export interface DocPublishConfigs { s3StagingBucketPath: string; } +const IS_LOCAL_PUBLISH = process.env.IS_LOCAL_PUBLISH === 'true'; + export const postpublishUtils = { generateConfig(packageJSON: any, tsConfigJSON: any, cwd: string): PostpublishConfigs { if (_.isUndefined(packageJSON.name)) { @@ -51,27 +53,30 @@ export const postpublishUtils = { return configs; }, async runAsync(packageJSON: any, tsConfigJSON: any, cwd: string): Promise<void> { - // const configs = postpublishUtils.generateConfig(packageJSON, tsConfigJSON, cwd); - // await postpublishUtils.publishReleaseNotesAsync( - // configs.cwd, - // configs.packageName, - // configs.version, - // configs.assets, - // ); - // if ( - // !_.isUndefined(configs.docPublishConfigs.s3BucketPath) || - // !_.isUndefined(configs.docPublishConfigs.s3StagingBucketPath) - // ) { - // utils.log('POSTPUBLISH: Release successful, generating docs...'); - // await postpublishUtils.generateAndUploadDocsAsync( - // configs.cwd, - // configs.docPublishConfigs.fileIncludes, - // configs.version, - // configs.docPublishConfigs.s3BucketPath, - // ); - // } else { - // utils.log(`POSTPUBLISH: No S3Bucket config found for ${packageJSON.name}. Skipping doc JSON generation.`); - // } + if (IS_LOCAL_PUBLISH) { + return; + } + const configs = postpublishUtils.generateConfig(packageJSON, tsConfigJSON, cwd); + await postpublishUtils.publishReleaseNotesAsync( + configs.cwd, + configs.packageName, + configs.version, + configs.assets, + ); + if ( + !_.isUndefined(configs.docPublishConfigs.s3BucketPath) || + !_.isUndefined(configs.docPublishConfigs.s3StagingBucketPath) + ) { + utils.log('POSTPUBLISH: Release successful, generating docs...'); + await postpublishUtils.generateAndUploadDocsAsync( + configs.cwd, + configs.docPublishConfigs.fileIncludes, + configs.version, + configs.docPublishConfigs.s3BucketPath, + ); + } else { + utils.log(`POSTPUBLISH: No S3Bucket config found for ${packageJSON.name}. Skipping doc JSON generation.`); + } }, async publishDocsToStagingAsync(packageJSON: any, tsConfigJSON: any, cwd: string): Promise<void> { const configs = postpublishUtils.generateConfig(packageJSON, tsConfigJSON, cwd); |