From c181b155b826371e5e33b4080da6ab0a5160c946 Mon Sep 17 00:00:00 2001 From: Nikhil Thorat Date: Thu, 15 Aug 2019 11:08:49 -0400 Subject: [PATCH] Update release script to send a single PR when multiple packages update with the same dep. --- scripts/release.ts | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/scripts/release.ts b/scripts/release.ts index 8f047d3b7b5..6146a97762d 100644 --- a/scripts/release.ts +++ b/scripts/release.ts @@ -121,6 +121,7 @@ async function main() { const packages = PHASES[phaseInt].packages; const deps = PHASES[phaseInt].deps || []; + const newVersions = []; for (let i = 0; i < packages.length; i++) { const packageName = packages[i]; @@ -208,17 +209,22 @@ async function main() { phase.scripts.forEach(script => $(script)); } - $(`git checkout -b b${newVersion}`); - $(`git push -u origin b${newVersion}`); - $(`git add .`); - $(`git commit -a -m "Update ${packageName} to ${newVersion}."`); - $(`git push`); - const title = - phase.title ? phase.title : `Update ${packageName} to ${newVersion}.`; - $(`hub pull-request --browse --message "${title}" --labels INTERNAL`); - console.log(); + newVersions.push(newVersion); } + const packageNames = packages.join(', '); + const versionNames = newVersions.join(', '); + const branchName = `b${newVersions.join('-')}`; + $(`git checkout -b ${branchName}`); + $(`git push -u origin ${branchName}`); + $(`git add .`); + $(`git commit -a -m "Update ${packageNames} to ${versionNames}."`); + $(`git push`); + const title = + phase.title ? phase.title : `Update ${packageNames} to ${versionNames}.`; + $(`hub pull-request --browse --message "${title}" --labels INTERNAL`); + console.log(); + console.log( `Done. FYI, this script does not publish to NPM. ` + `Please publish by running ./scripts/publish-npm.sh ` +