run-release-builds.ts 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import { parseArgs } from 'node:util';
  2. import { runReleaseCIJobs } from '../run-release-ci-jobs';
  3. const { values: { ghRelease, job, arch, ci, newVersion }, positionals } = parseArgs({
  4. options: {
  5. ghRelease: {
  6. type: 'boolean'
  7. },
  8. job: {
  9. type: 'string'
  10. },
  11. arch: {
  12. type: 'string'
  13. },
  14. ci: {
  15. type: 'string'
  16. },
  17. newVersion: {
  18. type: 'string'
  19. }
  20. },
  21. allowPositionals: true
  22. });
  23. const targetBranch = positionals[0];
  24. if (positionals.length < 1) {
  25. console.log(`Trigger CI to build release builds of electron.
  26. Usage: ci-release-build.js [--job=CI_JOB_NAME] [--arch=INDIVIDUAL_ARCH] [--ci=GitHubActions]
  27. [--ghRelease] [--commit=sha] [--newVersion=version_tag] TARGET_BRANCH
  28. `);
  29. process.exit(0);
  30. }
  31. if (ci === 'GitHubActions' || !ci) {
  32. if (!newVersion) {
  33. console.error('--newVersion is required for GitHubActions');
  34. process.exit(1);
  35. }
  36. }
  37. runReleaseCIJobs(targetBranch, {
  38. ci: ci as 'GitHubActions',
  39. ghRelease,
  40. job: job as any,
  41. arch,
  42. newVersion: newVersion!
  43. });