From fa7dddabb3c6c3e0e329c866cade0eb721e9ddad Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sun, 5 Jul 2020 10:19:06 -0500 Subject: [PATCH] make code-signing conditional --- script/vsts/get-release-version.js | 4 ++++ script/vsts/platforms/macos.yml | 2 +- script/vsts/platforms/windows.yml | 10 +++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/script/vsts/get-release-version.js b/script/vsts/get-release-version.js index 159128eed..4e8999d72 100644 --- a/script/vsts/get-release-version.js +++ b/script/vsts/get-release-version.js @@ -78,6 +78,7 @@ async function getReleaseVersion() { buildBranch.startsWith('electron-') || (buildBranch === 'master' && !process.env.SYSTEM_PULLREQUEST_PULLREQUESTNUMBER)); + const SHOULD_SIGN = process.env.SHOULD_SIGN; console.log( `##vso[task.setvariable variable=AppName;isOutput=true]${getAppName( @@ -90,6 +91,9 @@ async function getReleaseVersion() { console.log( `##vso[task.setvariable variable=IsSignedZipBranch;isOutput=true]${isSignedZipBranch}` ); + console.log( + `##vso[task.setvariable variable=SHOULD_SIGN;isOutput=true]${SHOULD_SIGN}` + ); } getReleaseVersion(); diff --git a/script/vsts/platforms/macos.yml b/script/vsts/platforms/macos.yml index a63faa770..fe03dce7d 100644 --- a/script/vsts/platforms/macos.yml +++ b/script/vsts/platforms/macos.yml @@ -47,7 +47,7 @@ jobs: displayName: Run linter - script: | - if [ $IS_RELEASE_BRANCH == "true" ] || [ $IS_SIGNED_ZIP_BRANCH == "true" ]; then + if [ $SHOULD_SIGN == "true" ] && ([ $IS_RELEASE_BRANCH == "true" ] || [ $IS_SIGNED_ZIP_BRANCH == "true" ]); then script/build --no-bootstrap --code-sign --compress-artifacts else script/build --no-bootstrap --compress-artifacts diff --git a/script/vsts/platforms/windows.yml b/script/vsts/platforms/windows.yml index d1035135d..b0ec07cc4 100644 --- a/script/vsts/platforms/windows.yml +++ b/script/vsts/platforms/windows.yml @@ -101,11 +101,19 @@ jobs: SET SQUIRREL_TEMP=C:\tmp IF [%IS_RELEASE_BRANCH%]==[true] ( ECHO Creating production artifacts for release branch %BUILD_SOURCEBRANCHNAME% - node script\vsts\windows-run.js script\build.cmd --no-bootstrap --code-sign --compress-artifacts --create-windows-installer + IF [%SHOULD_SIGN%]==[true] ( + node script\vsts\windows-run.js script\build.cmd --no-bootstrap --code-sign --compress-artifacts --create-windows-installer + ) ELSE ( + node script\vsts\windows-run.js script\build.cmd --no-bootstrap --compress-artifacts --create-windows-installer + ) ) ELSE ( IF [%IS_SIGNED_ZIP_BRANCH%]==[true] ( ECHO Creating signed CI artifacts for branch %BUILD_SOURCEBRANCHNAME% + IF [%SHOULD_SIGN%]==[true] ( node script\vsts\windows-run.js script\build.cmd --no-bootstrap --code-sign --compress-artifacts + ) ELSE ( + node script\vsts\windows-run.js script\build.cmd --no-bootstrap --compress-artifacts + ) ) ELSE ( ECHO Pull request build, no code signing will be performed node script\vsts\windows-run.js script\build.cmd --no-bootstrap --compress-artifacts