build: cleanup release scripts, separate cli entrypoints from logic (#44058)
* build: cleanup release scripts, separate cli entrypoints from logic * build: use repo/org constants
This commit is contained in:
parent
15c8759ee0
commit
f4ffd018e6
17 changed files with 410 additions and 300 deletions
53
script/release/bin/run-release-builds.ts
Normal file
53
script/release/bin/run-release-builds.ts
Normal file
|
@ -0,0 +1,53 @@
|
|||
import { parseArgs } from 'node:util';
|
||||
|
||||
import { runReleaseCIJobs } from '../run-release-ci-jobs';
|
||||
|
||||
const { values: { ghRelease, job, arch, ci, commit, newVersion }, positionals } = parseArgs({
|
||||
options: {
|
||||
ghRelease: {
|
||||
type: 'boolean'
|
||||
},
|
||||
job: {
|
||||
type: 'string'
|
||||
},
|
||||
arch: {
|
||||
type: 'string'
|
||||
},
|
||||
ci: {
|
||||
type: 'string'
|
||||
},
|
||||
commit: {
|
||||
type: 'string'
|
||||
},
|
||||
newVersion: {
|
||||
type: 'string'
|
||||
}
|
||||
},
|
||||
allowPositionals: true
|
||||
});
|
||||
|
||||
const targetBranch = positionals[0];
|
||||
|
||||
if (positionals.length < 1) {
|
||||
console.log(`Trigger CI to build release builds of electron.
|
||||
Usage: ci-release-build.js [--job=CI_JOB_NAME] [--arch=INDIVIDUAL_ARCH] [--ci=AppVeyor|GitHubActions]
|
||||
[--ghRelease] [--commit=sha] [--newVersion=version_tag] TARGET_BRANCH
|
||||
`);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
if (ci === 'GitHubActions' || !ci) {
|
||||
if (!newVersion) {
|
||||
console.error('--newVersion is required for GitHubActions');
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
runReleaseCIJobs(targetBranch, {
|
||||
ci: ci as 'GitHubActions' | 'AppVeyor',
|
||||
ghRelease,
|
||||
job: job as any,
|
||||
arch,
|
||||
newVersion: newVersion!,
|
||||
commit
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue