build: cleanup release scripts, separate cli entrypoints from logic (#44082)
* build: cleanup release scripts, separate cli entrypoints from logic Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com> * build: use repo/org constants Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
This commit is contained in:
parent
7b14a305f8
commit
6074f7ed31
17 changed files with 410 additions and 300 deletions
32
script/release/bin/prepare-for-release.ts
Normal file
32
script/release/bin/prepare-for-release.ts
Normal file
|
@ -0,0 +1,32 @@
|
|||
import { parseArgs } from 'node:util';
|
||||
|
||||
import { prepareRelease } from '../prepare-release';
|
||||
import { ELECTRON_REPO, isVersionBumpType, NIGHTLY_REPO } from '../types';
|
||||
|
||||
const { values: { branch }, positionals } = parseArgs({
|
||||
options: {
|
||||
branch: {
|
||||
type: 'string'
|
||||
}
|
||||
},
|
||||
allowPositionals: true
|
||||
});
|
||||
|
||||
const bumpType = positionals[0];
|
||||
|
||||
if (!bumpType || !isVersionBumpType(bumpType)) {
|
||||
console.log('Usage: prepare-for-release [stable | minor | beta | alpha | nightly]' +
|
||||
' (--branch=branch)');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
prepareRelease({
|
||||
isPreRelease: bumpType !== 'stable' && bumpType !== 'minor',
|
||||
targetRepo: bumpType === 'nightly' ? NIGHTLY_REPO : ELECTRON_REPO,
|
||||
targetBranch: branch,
|
||||
bumpType
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue