Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: version-utils respects main #29393

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions script/release/version-utils.js
Expand Up @@ -65,16 +65,17 @@ async function nextNightly (v) {
const pre = `nightly.${getCurrentDate()}`;

const branch = (await GitProcess.exec(['rev-parse', '--abbrev-ref', 'HEAD'], ELECTRON_DIR)).stdout.trim();
if (branch === 'master') {
next = semver.inc(await getLastMajorForMaster(), 'major');
// TODO(main-migration): Simplify once main branch is renamed
if (branch === 'master' || branch === 'main') {
next = semver.inc(await getLastMajorForMain(), 'major');
} else if (isStable(v)) {
next = semver.inc(next, 'patch');
}

return `${next}-${pre}`;
}

async function getLastMajorForMaster () {
async function getLastMajorForMain () {
let branchNames;
const result = await GitProcess.exec(['branch', '-a', '--remote', '--list', 'origin/[0-9]*-x-y'], ELECTRON_DIR);
if (result.exitCode === 0) {
Expand Down