aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-12-03 19:48:53 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-12-03 19:48:53 +0800
commit754be75dbfbb0ea4ca769d8810a76f382f31e031 (patch)
tree777c08d7c3a1dff5bf31a7974c2a1d80e777a04b /packages
parent5d70fe053da080c024fd49b832c57b973cc86bc0 (diff)
downloaddexon-0x-contracts-754be75dbfbb0ea4ca769d8810a76f382f31e031.tar
dexon-0x-contracts-754be75dbfbb0ea4ca769d8810a76f382f31e031.tar.gz
dexon-0x-contracts-754be75dbfbb0ea4ca769d8810a76f382f31e031.tar.bz2
dexon-0x-contracts-754be75dbfbb0ea4ca769d8810a76f382f31e031.tar.lz
dexon-0x-contracts-754be75dbfbb0ea4ca769d8810a76f382f31e031.tar.xz
dexon-0x-contracts-754be75dbfbb0ea4ca769d8810a76f382f31e031.tar.zst
dexon-0x-contracts-754be75dbfbb0ea4ca769d8810a76f382f31e031.zip
Fix hardcoded path in release notes fetching
Diffstat (limited to 'packages')
-rw-r--r--packages/monorepo-scripts/CHANGELOG.json4
-rw-r--r--packages/monorepo-scripts/src/utils/github_release_utils.ts12
2 files changed, 7 insertions, 9 deletions
diff --git a/packages/monorepo-scripts/CHANGELOG.json b/packages/monorepo-scripts/CHANGELOG.json
index 170a97a33..428168437 100644
--- a/packages/monorepo-scripts/CHANGELOG.json
+++ b/packages/monorepo-scripts/CHANGELOG.json
@@ -13,6 +13,10 @@
{
"note": "Add ForwarderError to the IGNORED_EXCESSIVE_TYPES array",
"pr": 1147
+ },
+ {
+ "note": "Fix a bug when hardcoded CHANGELOG paths cause fetching release notes to fail",
+ "pr": 1311
}
]
},
diff --git a/packages/monorepo-scripts/src/utils/github_release_utils.ts b/packages/monorepo-scripts/src/utils/github_release_utils.ts
index 7434d397e..e63244b46 100644
--- a/packages/monorepo-scripts/src/utils/github_release_utils.ts
+++ b/packages/monorepo-scripts/src/utils/github_release_utils.ts
@@ -41,7 +41,7 @@ export async function publishReleaseNotesAsync(packagesToPublish: Package[], isD
let assets: string[] = [];
let aggregateNotes = '';
_.each(packagesToPublish, pkg => {
- aggregateNotes += getReleaseNotesForPackage(pkg.packageJson.name);
+ aggregateNotes += getReleaseNotesForPackage(pkg.location, pkg.packageJson.name);
const packageAssets = _.get(pkg.packageJson, 'config.postpublish.assets');
if (!_.isUndefined(packageAssets)) {
@@ -88,14 +88,8 @@ function adjustAssetPaths(assets: string[]): string[] {
return finalAssets;
}
-function getReleaseNotesForPackage(packageName: string): string {
- const packageNameWithoutNamespace = packageName.replace('@0x/', '');
- const changelogJSONPath = path.join(
- constants.monorepoRootPath,
- 'packages',
- packageNameWithoutNamespace,
- 'CHANGELOG.json',
- );
+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);
const latestLog = changelogs[0];