Skip to content

Commit

Permalink
make code-signing conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Jul 7, 2020
1 parent 96ee161 commit 9755960
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions script/vsts/get-release-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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();
2 changes: 1 addition & 1 deletion script/vsts/platforms/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion script/vsts/platforms/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9755960

Please sign in to comment.