From 467409458e716c68b35fa935d556050ca6bed1c4 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Wed, 23 Oct 2019 14:07:10 -0400 Subject: [PATCH] build: add support for automated minor releases (#20620) * build: add support for automated minor releases * Add test for minor bump --- script/release/prepare-release.js | 2 +- script/release/version-bumper.js | 3 +++ spec-main/version-bump-spec.ts | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/script/release/prepare-release.js b/script/release/prepare-release.js index 7300b69283e0..e720240a673a 100755 --- a/script/release/prepare-release.js +++ b/script/release/prepare-release.js @@ -23,7 +23,7 @@ const pass = '✓'.green const fail = '✗'.red if (!bumpType && !args.notesOnly) { - console.log(`Usage: prepare-release [stable | beta | nightly]` + + console.log(`Usage: prepare-release [stable | minor | beta | nightly]` + ` (--stable) (--notesOnly) (--automaticRelease) (--branch)`) process.exit(1) } diff --git a/script/release/version-bumper.js b/script/release/version-bumper.js index 5c144a2e65c3..96ef9c3dadc4 100644 --- a/script/release/version-bumper.js +++ b/script/release/version-bumper.js @@ -90,6 +90,9 @@ async function nextVersion (bumpType, version) { break case 'beta': throw new Error('Cannot bump to beta from stable.') + case 'minor': + version = semver.inc(version, 'minor') + break case 'stable': version = semver.inc(version, 'patch') break diff --git a/spec-main/version-bump-spec.ts b/spec-main/version-bump-spec.ts index db8b7272d42b..172f760050fe 100644 --- a/spec-main/version-bump-spec.ts +++ b/spec-main/version-bump-spec.ts @@ -100,6 +100,12 @@ describe('version-bumper', () => { expect(next).to.equal('2.0.1') }) + it('bumps to minor from stable', async () => { + const version = 'v2.0.0' + const next = await nextVersion('minor', version) + expect(next).to.equal('2.1.0') + }) + it('bumps to stable from nightly', async () => { const version = 'v2.0.0-nightly.19950901' const next = await nextVersion('stable', version)