make code-signing conditional

This commit is contained in:
Amin Yahyaabadi 2020-07-05 10:19:06 -05:00 committed by DeeDeeG
parent 217cee16a8
commit fa7dddabb3
3 changed files with 14 additions and 2 deletions

View File

@ -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();

View File

@ -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

View File

@ -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