build: run gha on tag not branch (#42490)
This commit is contained in:
parent
c41ded2e89
commit
b7aad14e8d
2 changed files with 8 additions and 5 deletions
|
@ -93,7 +93,7 @@ async function githubActionsCall (targetBranch, workflowName, options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
await octokit.request(`POST ${GH_ACTIONS_API_URL}/workflows/${workflowName}.yml/dispatches`, {
|
await octokit.request(`POST ${GH_ACTIONS_API_URL}/workflows/${workflowName}.yml/dispatches`, {
|
||||||
ref: buildRequest.branch,
|
ref: `refs/tags/${options.newVersion}`,
|
||||||
inputs: {
|
inputs: {
|
||||||
...buildRequest.parameters
|
...buildRequest.parameters
|
||||||
},
|
},
|
||||||
|
|
|
@ -158,9 +158,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
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,6 +191,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) {
|
||||||
|
@ -225,10 +228,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);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue