aboutsummaryrefslogtreecommitdiffstats
path: root/packages/monorepo-scripts/src/utils/github_release_utils.ts
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2019-01-03 06:46:31 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2019-01-03 06:46:31 +0800
commit472f89bd3d459c8b5c29de8a808381bf19c8c72b (patch)
tree7de44fb721961667688b9025b4516228b567d029 /packages/monorepo-scripts/src/utils/github_release_utils.ts
parent9b540fd8e52e7578d3749e6d9ef9cd97d602ffb3 (diff)
downloaddexon-sol-tools-472f89bd3d459c8b5c29de8a808381bf19c8c72b.tar
dexon-sol-tools-472f89bd3d459c8b5c29de8a808381bf19c8c72b.tar.gz
dexon-sol-tools-472f89bd3d459c8b5c29de8a808381bf19c8c72b.tar.bz2
dexon-sol-tools-472f89bd3d459c8b5c29de8a808381bf19c8c72b.tar.lz
dexon-sol-tools-472f89bd3d459c8b5c29de8a808381bf19c8c72b.tar.xz
dexon-sol-tools-472f89bd3d459c8b5c29de8a808381bf19c8c72b.tar.zst
dexon-sol-tools-472f89bd3d459c8b5c29de8a808381bf19c8c72b.zip
feat(monorepo-scripts): Alert to discord when new publish happens
Diffstat (limited to 'packages/monorepo-scripts/src/utils/github_release_utils.ts')
-rw-r--r--packages/monorepo-scripts/src/utils/github_release_utils.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/monorepo-scripts/src/utils/github_release_utils.ts b/packages/monorepo-scripts/src/utils/github_release_utils.ts
index e63244b46..1044c25e9 100644
--- a/packages/monorepo-scripts/src/utils/github_release_utils.ts
+++ b/packages/monorepo-scripts/src/utils/github_release_utils.ts
@@ -12,7 +12,10 @@ import { utils } from './utils';
const publishReleaseAsync = promisify(publishRelease);
// tslint:disable-next-line:completed-docs
-export async function publishReleaseNotesAsync(packagesToPublish: Package[], isDryRun: boolean): Promise<void> {
+export async function publishReleaseNotesAsync(
+ packagesToPublish: Package[],
+ isDryRun: boolean,
+): Promise<string | undefined> {
// Git push a tag representing this publish (publish-{commit-hash}) (truncate hash)
const result = await execAsync('git log -n 1 --pretty=format:"%H"', { cwd: constants.monorepoRootPath });
const latestGitCommit = result.stdout;
@@ -75,6 +78,8 @@ export async function publishReleaseNotesAsync(packagesToPublish: Package[], isD
utils.log('Publishing release notes ', releaseName, '...');
await publishReleaseAsync(publishReleaseConfigs);
+
+ return aggregateNotes;
}
// Asset paths should described from the monorepo root. This method prefixes
@@ -88,7 +93,7 @@ function adjustAssetPaths(assets: string[]): string[] {
return finalAssets;
}
-function getReleaseNotesForPackage(packageLocation: string, packageName: string): string {
+export function getReleaseNotesForPackage(packageLocation: string, packageName: string): string {
const changelogJSONPath = path.join(packageLocation, 'CHANGELOG.json');
const changelogJSON = readFileSync(changelogJSONPath, 'utf-8');
const changelogs = JSON.parse(changelogJSON);