Skip to content

Commit c0657a4

Browse files
build: fix nightly version bumping (electron#21079)
* build: fix nightly version bumping * spec: add a test for bumping nightlies beyond the 8-x-y branch switch * Update version-bump-spec.ts
1 parent d9d89ee commit c0657a4

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

script/release/version-utils.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ async function nextNightly (v) {
7272

7373
async function getLastMajorForMaster () {
7474
let branchNames
75-
const result = await GitProcess.exec(['branch', '-a', '--remote', '--list', 'origin/[0-9]-[0-9]-x'], ELECTRON_DIR)
75+
const result = await GitProcess.exec(['branch', '-a', '--remote', '--list', 'origin/[0-9]*-x-y'], ELECTRON_DIR)
7676
if (result.exitCode === 0) {
7777
branchNames = result.stdout.trim().split('\n')
7878
const filtered = branchNames.map(b => b.replace('origin/', ''))
@@ -83,7 +83,7 @@ async function getLastMajorForMaster () {
8383
}
8484

8585
function getNextReleaseBranch (branches) {
86-
const converted = branches.map(b => b.replace(/-/g, '.').replace('x', '0'))
86+
const converted = branches.map(b => b.replace(/-/g, '.').replace('x', '0').replace('y', '0'))
8787
return converted.reduce((v1, v2) => semver.gt(v1, v2) ? v1 : v2)
8888
}
8989

spec-main/version-bump-spec.ts

+7
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ describe('version-bumper', () => {
6868
expect(matches).to.have.lengthOf(1)
6969
})
7070

71+
it('bumps to a nightly version above our switch from N-0-x to N-x-y branch names', async () => {
72+
const version = 'v2.0.0-nightly.19950901'
73+
const next = await nextVersion('nightly', version)
74+
// If it starts with v8 then we didn't bump above the 8-x-y branch
75+
expect(next.startsWith('v8')).to.equal(false)
76+
})
77+
7178
it('throws error when bumping to beta from stable', () => {
7279
const version = 'v2.0.0'
7380
return expect(

0 commit comments

Comments
 (0)