fix: improve release notes (#16343)

* fix: use version name in release notes

* fix: omit previously-released notes

* fix: sniff semantic commit types from PR subjects

instead of only from commit messages

* fix: do not use unrecognized semantic commit types

* chore: do not hardcode Release-Notes comment text

It used to be '<!-- One-line Change Summary Here-->',
it's currently a link to a best-practices page, and
it'll probably change again in the future. Let's just
match on <!--.*--> instead.

* chore: copyedit the help page

* chore: use clerk's OMIT_FROM_RELEASE_NOTES_KEYS

* chore: tweak comments

* chore: rename 'breaks' property as 'breaking'
This commit is contained in:
Charles Kerr 2019-01-10 14:01:38 -06:00 committed by GitHub
parent 102d8fe506
commit 2acf9ac72f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 116 additions and 40 deletions

View file

@ -50,12 +50,12 @@ async function getNewVersion (dryRun) {
}
}
async function getReleaseNotes (currentBranch) {
async function getReleaseNotes (currentBranch, newVersion) {
if (bumpType === 'nightly') {
return { text: 'Nightlies do not get release notes, please compare tags for info.' }
}
console.log(`Generating release notes for ${currentBranch}.`)
const releaseNotes = await releaseNotesGenerator(currentBranch)
const releaseNotes = await releaseNotesGenerator(currentBranch, newVersion)
if (releaseNotes.warning) {
console.warn(releaseNotes.warning)
}
@ -63,8 +63,8 @@ async function getReleaseNotes (currentBranch) {
}
async function createRelease (branchToTarget, isBeta) {
const releaseNotes = await getReleaseNotes(branchToTarget)
const newVersion = await getNewVersion()
const releaseNotes = await getReleaseNotes(branchToTarget, newVersion)
await tagRelease(newVersion)
console.log(`Checking for existing draft release.`)
@ -194,7 +194,8 @@ async function prepareRelease (isBeta, notesOnly) {
} else {
const currentBranch = (args.branch) ? args.branch : await getCurrentBranch(gitDir)
if (notesOnly) {
const releaseNotes = await getReleaseNotes(currentBranch)
const newVersion = await getNewVersion(true)
const releaseNotes = await getReleaseNotes(currentBranch, newVersion)
console.log(`Draft release notes are: \n${releaseNotes.text}`)
} else {
const changes = await changesToRelease(currentBranch)