DevTools release script: Show changelog before minor/patch prompt (#24200)
This commit is contained in:
parent
27199d7567
commit
c9100d95b9
|
@ -31,6 +31,16 @@ async function main() {
|
|||
|
||||
await checkNPMPermissions();
|
||||
|
||||
const sha = await getPreviousCommitSha();
|
||||
const [shortCommitLog, formattedCommitLog] = await getCommitLog(sha);
|
||||
|
||||
console.log('');
|
||||
console.log(
|
||||
'This release includes the following commits:',
|
||||
chalk.gray(shortCommitLog)
|
||||
);
|
||||
console.log('');
|
||||
|
||||
const releaseType = await getReleaseType();
|
||||
|
||||
const path = join(ROOT_PATH, PACKAGE_PATHS[0]);
|
||||
|
@ -41,6 +51,10 @@ async function main() {
|
|||
? `${major}.${minor + 1}.0`
|
||||
: `${major}.${minor}.${patch + 1}`;
|
||||
|
||||
updateChangelog(nextVersion, formattedCommitLog);
|
||||
|
||||
await reviewChangelogPrompt();
|
||||
|
||||
updatePackageVersions(previousVersion, nextVersion);
|
||||
updateManifestVersions(previousVersion, nextVersion);
|
||||
|
||||
|
@ -52,13 +66,6 @@ async function main() {
|
|||
);
|
||||
console.log('');
|
||||
|
||||
const sha = await getPreviousCommitSha();
|
||||
const commitLog = await getCommitLog(sha);
|
||||
|
||||
updateChangelog(nextVersion, commitLog);
|
||||
|
||||
await reviewChangelogPrompt();
|
||||
|
||||
await commitPendingChanges(previousVersion, nextVersion);
|
||||
|
||||
printFinalInstructions();
|
||||
|
@ -89,6 +96,7 @@ async function commitPendingChanges(previousVersion, nextVersion) {
|
|||
}
|
||||
|
||||
async function getCommitLog(sha) {
|
||||
let shortLog = '';
|
||||
let formattedLog = '';
|
||||
|
||||
const rawLog = await execRead(`
|
||||
|
@ -103,12 +111,14 @@ async function getCommitLog(sha) {
|
|||
const pr = match[2];
|
||||
|
||||
formattedLog += `\n* ${title} ([USERNAME](https://github.com/USERNAME) in [#${pr}](${PULL_REQUEST_BASE_URL}${pr}))`;
|
||||
shortLog += `\n* ${title}`;
|
||||
} else {
|
||||
formattedLog += `\n* ${line}`;
|
||||
shortLog += `\n* ${line}`;
|
||||
}
|
||||
});
|
||||
|
||||
return formattedLog;
|
||||
return [shortLog, formattedLog];
|
||||
}
|
||||
|
||||
async function getPreviousCommitSha() {
|
||||
|
|
Loading…
Reference in New Issue