build: fix release, add newVersion for tagging (#42846)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
This commit is contained in:
trop[bot] 2024-07-09 16:10:34 -07:00 committed by GitHub
parent 5271a49fe8
commit c1741b90d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,7 +14,11 @@ const readline = require('node:readline');
const releaseNotesGenerator = require('./notes/index.js'); const releaseNotesGenerator = require('./notes/index.js');
const { getCurrentBranch, ELECTRON_DIR } = require('../lib/utils.js'); const { getCurrentBranch, ELECTRON_DIR } = require('../lib/utils.js');
const bumpType = args._[0]; const bumpType = args._[0];
const targetRepo = bumpType === 'nightly' ? 'nightlies' : 'electron'; const targetRepo = getRepo();
function getRepo () {
return bumpType === 'nightly' ? 'nightlies' : 'electron';
}
const octokit = new Octokit({ const octokit = new Octokit({
auth: process.env.ELECTRON_GITHUB_TOKEN auth: process.env.ELECTRON_GITHUB_TOKEN
@ -138,9 +142,10 @@ async function pushRelease (branch) {
} }
} }
async function runReleaseBuilds (branch) { async function runReleaseBuilds (branch, newVersion) {
await ciReleaseBuild(branch, { await ciReleaseBuild(branch, {
ghRelease: true ghRelease: true,
newVersion
}); });
} }
@ -170,6 +175,8 @@ async function verifyNewVersion () {
console.log(`${fail} Aborting release of ${newVersion}`); console.log(`${fail} Aborting release of ${newVersion}`);
process.exit(); process.exit();
} }
return newVersion;
} }
async function promptForVersion (version) { async function promptForVersion (version) {
@ -205,10 +212,10 @@ async function prepareRelease (isBeta, notesOnly) {
} else { } else {
const changes = await changesToRelease(); const changes = await changesToRelease();
if (changes) { if (changes) {
await verifyNewVersion(); const newVersion = await verifyNewVersion();
await createRelease(currentBranch, isBeta); await createRelease(currentBranch, isBeta);
await pushRelease(currentBranch); await pushRelease(currentBranch);
await runReleaseBuilds(currentBranch); await runReleaseBuilds(currentBranch, newVersion);
} else { } else {
console.log('There are no new changes to this branch since the last release, aborting release.'); console.log('There are no new changes to this branch since the last release, aborting release.');
process.exit(1); process.exit(1);