From b7aad14e8d1c147866f158165c46b6b247527e99 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Thu, 13 Jun 2024 17:14:45 -0500 Subject: [PATCH] build: run gha on tag not branch (#42490) --- script/release/ci-release-build.js | 2 +- script/release/prepare-release.js | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/script/release/ci-release-build.js b/script/release/ci-release-build.js index 2401cd0ecd04..207be6222576 100644 --- a/script/release/ci-release-build.js +++ b/script/release/ci-release-build.js @@ -93,7 +93,7 @@ async function githubActionsCall (targetBranch, workflowName, options) { } await octokit.request(`POST ${GH_ACTIONS_API_URL}/workflows/${workflowName}.yml/dispatches`, { - ref: buildRequest.branch, + ref: `refs/tags/${options.newVersion}`, inputs: { ...buildRequest.parameters }, diff --git a/script/release/prepare-release.js b/script/release/prepare-release.js index c84580e4bfed..25e2c7490cdd 100755 --- a/script/release/prepare-release.js +++ b/script/release/prepare-release.js @@ -158,9 +158,10 @@ async function pushRelease (branch) { } } -async function runReleaseBuilds (branch) { +async function runReleaseBuilds (branch, newVersion) { await ciReleaseBuild(branch, { - ghRelease: true + ghRelease: true, + newVersion }); } @@ -190,6 +191,8 @@ async function verifyNewVersion () { console.log(`${fail} Aborting release of ${newVersion}`); process.exit(); } + + return newVersion; } async function promptForVersion (version) { @@ -225,10 +228,10 @@ async function prepareRelease (isBeta, notesOnly) { } else { const changes = await changesToRelease(); if (changes) { - await verifyNewVersion(); + const newVersion = await verifyNewVersion(); await createRelease(currentBranch, isBeta); await pushRelease(currentBranch); - await runReleaseBuilds(currentBranch); + await runReleaseBuilds(currentBranch, newVersion); } else { console.log('There are no new changes to this branch since the last release, aborting release.'); process.exit(1);