build: remove individual release build workflows (#29344)

* build: remove individual release build workflows

* build: ensure even builds we do not want to run have at least one step
This commit is contained in:
Samuel Attard 2021-06-07 07:17:27 -07:00 committed by GitHub
parent 070f25db54
commit c48ec133a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 110 additions and 180 deletions

View file

@ -17,46 +17,24 @@ parameters:
type: boolean type: boolean
default: true default: true
run-linux-x64-publish:
type: boolean
default: false
run-linux-ia32-publish:
type: boolean
default: false
run-linux-arm-publish:
type: boolean
default: false
run-linux-arm64-publish:
type: boolean
default: false
run-osx-publish:
type: boolean
default: false
run-osx-publish-arm64:
type: boolean
default: false
run-mas-publish:
type: boolean
default: false
run-mas-publish-arm64:
type: boolean
default: false
run-linux-publish: run-linux-publish:
type: boolean type: boolean
default: false default: false
linux-publish-arch-limit:
type: enum
default: all
enum: ["all", "arm", "arm64", "x64", "ia32"]
run-macos-publish: run-macos-publish:
type: boolean type: boolean
default: false default: false
macos-publish-arch-limit:
type: enum
default: all
enum: ["all", "osx-x64", "osx-arm64", "mas-x64", "mas-arm64"]
# Executors # Executors
executors: executors:
linux-docker: linux-docker:
@ -1829,9 +1807,16 @@ jobs:
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >> UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status <<: *env-ninja-status
steps: steps:
- electron-publish: - run: echo running
attach: false - when:
checkout: true condition:
or:
- equal: ["all", << pipeline.parameters.linux-publish-arch-limit >>]
- equal: ["x64", << pipeline.parameters.linux-publish-arch-limit >>]
steps:
- electron-publish:
attach: false
checkout: true
linux-ia32-testing: linux-ia32-testing:
executor: linux-docker executor: linux-docker
@ -1871,9 +1856,16 @@ jobs:
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >> UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status <<: *env-ninja-status
steps: steps:
- electron-publish: - run: echo running
attach: false - when:
checkout: true condition:
or:
- equal: ["all", << pipeline.parameters.linux-publish-arch-limit >>]
- equal: ["ia32", << pipeline.parameters.linux-publish-arch-limit >>]
steps:
- electron-publish:
attach: false
checkout: true
linux-arm-testing: linux-arm-testing:
executor: linux-docker executor: linux-docker
@ -1916,9 +1908,16 @@ jobs:
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >> UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status <<: *env-ninja-status
steps: steps:
- electron-publish: - run: echo running
attach: false - when:
checkout: true condition:
or:
- equal: ["all", << pipeline.parameters.linux-publish-arch-limit >>]
- equal: ["arm", << pipeline.parameters.linux-publish-arch-limit >>]
steps:
- electron-publish:
attach: false
checkout: true
linux-arm64-testing: linux-arm64-testing:
executor: linux-docker executor: linux-docker
@ -1970,9 +1969,16 @@ jobs:
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >> UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status <<: *env-ninja-status
steps: steps:
- electron-publish: - run: echo running
attach: false - when:
checkout: true condition:
or:
- equal: ["all", << pipeline.parameters.linux-publish-arch-limit >>]
- equal: ["arm64", << pipeline.parameters.linux-publish-arch-limit >>]
steps:
- electron-publish:
attach: false
checkout: true
osx-testing-x64: osx-testing-x64:
executor: macos executor: macos
@ -1998,31 +2004,6 @@ jobs:
<<: *env-testing-build <<: *env-testing-build
<<: *steps-electron-gn-check <<: *steps-electron-gn-check
osx-publish-x64:
executor: macos
environment:
<<: *env-mac-large-release
<<: *env-release-build
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status
steps:
- electron-publish:
attach: false
checkout: true
osx-publish-arm64:
executor: macos
environment:
<<: *env-mac-large-release
<<: *env-release-build
<<: *env-apple-silicon
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status
steps:
- electron-publish:
attach: false
checkout: true
osx-publish-x64-skip-checkout: osx-publish-x64-skip-checkout:
executor: macos executor: macos
environment: environment:
@ -2031,9 +2012,16 @@ jobs:
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >> UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status <<: *env-ninja-status
steps: steps:
- electron-publish: - run: echo running
attach: true - when:
checkout: false condition:
or:
- equal: ["all", << pipeline.parameters.macos-publish-arch-limit >>]
- equal: ["osx-x64", << pipeline.parameters.macos-publish-arch-limit >>]
steps:
- electron-publish:
attach: true
checkout: false
osx-publish-arm64-skip-checkout: osx-publish-arm64-skip-checkout:
executor: macos executor: macos
@ -2044,9 +2032,16 @@ jobs:
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >> UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status <<: *env-ninja-status
steps: steps:
- electron-publish: - run: echo running
attach: true - when:
checkout: false condition:
or:
- equal: ["all", << pipeline.parameters.macos-publish-arch-limit >>]
- equal: ["osx-arm64", << pipeline.parameters.macos-publish-arch-limit >>]
steps:
- electron-publish:
attach: true
checkout: false
osx-testing-arm64: osx-testing-arm64:
executor: macos executor: macos
@ -2090,32 +2085,6 @@ jobs:
<<: *env-mas <<: *env-mas
<<: *env-testing-build <<: *env-testing-build
<<: *steps-electron-gn-check <<: *steps-electron-gn-check
mas-publish:
executor: macos
environment:
<<: *env-mac-large-release
<<: *env-mas
<<: *env-release-build
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status
steps:
- electron-publish:
attach: false
checkout: true
mas-publish-arm64:
executor: macos
environment:
<<: *env-mac-large-release
<<: *env-mas-apple-silicon
<<: *env-release-build
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status
steps:
- electron-publish:
attach: false
checkout: true
mas-publish-x64-skip-checkout: mas-publish-x64-skip-checkout:
executor: macos executor: macos
@ -2125,9 +2094,16 @@ jobs:
<<: *env-release-build <<: *env-release-build
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >> UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
steps: steps:
- electron-publish: - run: echo running
attach: true - when:
checkout: false condition:
or:
- equal: ["all", << pipeline.parameters.macos-publish-arch-limit >>]
- equal: ["mas-x64", << pipeline.parameters.macos-publish-arch-limit >>]
steps:
- electron-publish:
attach: true
checkout: false
mas-publish-arm64-skip-checkout: mas-publish-arm64-skip-checkout:
executor: macos executor: macos
@ -2138,9 +2114,16 @@ jobs:
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >> UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *env-ninja-status <<: *env-ninja-status
steps: steps:
- electron-publish: - run: echo running
attach: true - when:
checkout: false condition:
or:
- equal: ["all", << pipeline.parameters.macos-publish-arch-limit >>]
- equal: ["mas-arm64", << pipeline.parameters.macos-publish-arch-limit >>]
steps:
- electron-publish:
attach: true
checkout: false
mas-testing-arm64: mas-testing-arm64:
executor: macos executor: macos
@ -2361,12 +2344,6 @@ jobs:
workflows: workflows:
version: 2.1 version: 2.1
# The publish workflows below each contain one job so that they are
# compatible with how sudowoodo works today. If these workflows are
# changed to have multiple jobs, then scripts/release/ci-release-build.js
# will need to be updated and there will most likely need to be changes to
# sudowoodo
publish-linux: publish-linux:
when: << pipeline.parameters.run-linux-publish >> when: << pipeline.parameters.run-linux-publish >>
jobs: jobs:
@ -2379,54 +2356,6 @@ workflows:
- linux-arm64-publish: - linux-arm64-publish:
context: release-env context: release-env
publish-x64-linux:
when: << pipeline.parameters.run-linux-x64-publish >>
jobs:
- linux-x64-publish:
context: release-env
publish-ia32-linux:
when: << pipeline.parameters.run-linux-ia32-publish >>
jobs:
- linux-ia32-publish:
context: release-env
publish-arm-linux:
when: << pipeline.parameters.run-linux-arm-publish >>
jobs:
- linux-arm-publish:
context: release-env
publish-arm64-linux:
when: << pipeline.parameters.run-linux-arm64-publish >>
jobs:
- linux-arm64-publish:
context: release-env
publish-osx:
when: << pipeline.parameters.run-osx-publish >>
jobs:
- osx-publish-x64:
context: release-env
publish-mas:
when: << pipeline.parameters.run-mas-publish >>
jobs:
- mas-publish:
context: release-env
publish-osx-arm64:
when: << pipeline.parameters.run-osx-publish-arm64 >>
jobs:
- osx-publish-arm64:
context: release-env
publish-mas-arm64:
when: << pipeline.parameters.run-mas-publish-arm64 >>
jobs:
- mas-publish-arm64:
context: release-env
publish-macos: publish-macos:
when: << pipeline.parameters.run-macos-publish >> when: << pipeline.parameters.run-macos-publish >>
jobs: jobs:

View file

@ -20,16 +20,10 @@ const circleCIPublishWorkflows = [
'macos-publish' 'macos-publish'
]; ];
const circleCIJobs = circleCIPublishWorkflows.concat([ const circleCIPublishIndividualArches = {
'linux-arm-publish', 'macos-publish': ['osx-x64', 'mas-x64', 'osx-arm64', 'mas-arm64'],
'linux-arm64-publish', 'linux-publish': ['arm', 'arm64', 'ia32', 'x64']
'linux-ia32-publish', };
'linux-x64-publish',
'mas-publish',
'mas-publish-arm64',
'osx-publish',
'osx-publish-arm64'
]);
const vstsArmJobs = [ const vstsArmJobs = [
'electron-arm-testing', 'electron-arm-testing',
@ -68,8 +62,8 @@ async function makeRequest (requestOptions, parseResponse) {
}); });
} }
async function circleCIcall (targetBranch, job, options) { async function circleCIcall (targetBranch, workflowName, options) {
console.log(`Triggering CircleCI to run build job: ${job} on branch: ${targetBranch} with release flag.`); console.log(`Triggering CircleCI to run build job: ${workflowName} on branch: ${targetBranch} with release flag.`);
const buildRequest = { const buildRequest = {
branch: targetBranch, branch: targetBranch,
parameters: { parameters: {
@ -83,7 +77,13 @@ async function circleCIcall (targetBranch, job, options) {
} else { } else {
buildRequest.parameters['upload-to-s3'] = '1'; buildRequest.parameters['upload-to-s3'] = '1';
} }
buildRequest.parameters[`run-${job}`] = true; buildRequest.parameters[`run-${workflowName}`] = true;
if (options.arch) {
const validArches = circleCIPublishIndividualArches[workflowName];
assert(validArches.includes(options.arch), `Unknown CircleCI architecture "${options.arch}". Valid values are ${JSON.stringify(validArches)}`);
buildRequest.parameters['macos-publish-arch-limit'] = options.arch;
}
jobRequestedCount++; jobRequestedCount++;
// The logic below expects that the CircleCI workflows for releases each // The logic below expects that the CircleCI workflows for releases each
// contain only one job in order to maintain compatibility with sudowoodo. // contain only one job in order to maintain compatibility with sudowoodo.
@ -91,22 +91,22 @@ async function circleCIcall (targetBranch, job, options) {
// also need to be changed as well as possibly changing sudowoodo. // also need to be changed as well as possibly changing sudowoodo.
try { try {
const circleResponse = await circleCIRequest(CIRCLECI_PIPELINE_URL, 'POST', buildRequest); const circleResponse = await circleCIRequest(CIRCLECI_PIPELINE_URL, 'POST', buildRequest);
console.log(`CircleCI release build pipeline ${circleResponse.id} for ${job} triggered.`); console.log(`CircleCI release build pipeline ${circleResponse.id} for ${workflowName} triggered.`);
const workflowId = await getCircleCIWorkflowId(circleResponse.id); const workflowId = await getCircleCIWorkflowId(circleResponse.id);
if (workflowId === -1) { if (workflowId === -1) {
return; return;
} }
const workFlowUrl = `https://circleci.com/workflow-run/${workflowId}`; const workFlowUrl = `https://circleci.com/workflow-run/${workflowId}`;
if (options.runningPublishWorkflows) { if (options.runningPublishWorkflows) {
console.log(`CircleCI release workflow request for ${job} successful. Check ${workFlowUrl} for status.`); console.log(`CircleCI release workflow request for ${workflowName} successful. Check ${workFlowUrl} for status.`);
} else { } else {
console.log(`CircleCI release build workflow running at https://circleci.com/workflow-run/${workflowId} for ${job}.`); console.log(`CircleCI release build workflow running at https://circleci.com/workflow-run/${workflowId} for ${workflowName}.`);
const jobNumber = await getCircleCIJobNumber(workflowId); const jobNumber = await getCircleCIJobNumber(workflowId);
if (jobNumber === -1) { if (jobNumber === -1) {
return; return;
} }
const jobUrl = `https://circleci.com/gh/electron/electron/${jobNumber}`; const jobUrl = `https://circleci.com/gh/electron/electron/${jobNumber}`;
console.log(`CircleCI release build request for ${job} successful. Check ${jobUrl} for status.`); console.log(`CircleCI release build request for ${workflowName} successful. Check ${jobUrl} for status.`);
} }
} catch (err) { } catch (err) {
console.log('Error calling CircleCI: ', err); console.log('Error calling CircleCI: ', err);
@ -247,9 +247,10 @@ async function callAppVeyor (targetBranch, job, options) {
function buildCircleCI (targetBranch, options) { function buildCircleCI (targetBranch, options) {
if (options.job) { if (options.job) {
assert(circleCIJobs.includes(options.job), `Unknown CircleCI job name: ${options.job}. Valid values are: ${circleCIJobs}.`); assert(circleCIPublishWorkflows.includes(options.job), `Unknown CircleCI workflow name: ${options.job}. Valid values are: ${circleCIPublishWorkflows}.`);
circleCIcall(targetBranch, options.job, options); circleCIcall(targetBranch, options.job, options);
} else { } else {
assert(!options.arch, 'Cannot provide a single architecture while building all workflows, please specify a single workflow via --workflow');
options.runningPublishWorkflows = true; options.runningPublishWorkflows = true;
circleCIPublishWorkflows.forEach((job) => circleCIcall(targetBranch, job, options)); circleCIPublishWorkflows.forEach((job) => circleCIcall(targetBranch, job, options));
} }
@ -364,7 +365,7 @@ if (require.main === module) {
const targetBranch = args._[0]; const targetBranch = args._[0];
if (args._.length < 1) { if (args._.length < 1) {
console.log(`Trigger CI to build release builds of electron. console.log(`Trigger CI to build release builds of electron.
Usage: ci-release-build.js [--job=CI_JOB_NAME] [--ci=CircleCI|AppVeyor|VSTS|DevOps] Usage: ci-release-build.js [--job=CI_JOB_NAME] [--arch=INDIVIDUAL_ARCH] [--ci=CircleCI|AppVeyor|VSTS|DevOps]
[--ghRelease] [--armTest] [--circleBuildNum=xxx] [--appveyorJobId=xxx] TARGET_BRANCH [--ghRelease] [--armTest] [--circleBuildNum=xxx] [--appveyorJobId=xxx] TARGET_BRANCH
`); `);
process.exit(0); process.exit(0);