Skip to content

Commit 1f88573

Browse files
committed
Fix code-sign target failures on TravisCI
1 parent 7aa6348 commit 1f88573

File tree

3 files changed

+35
-29
lines changed

3 files changed

+35
-29
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: 2.2.5.{build}
22
build_script:
3-
- ps: .\build.ps1 -IsOfficialBuild
3+
- ps: .\build.ps1 -ci
44
- ps: .\docs\generate.ps1 -NoBuild -Verbose
55
environment:
66
KEYVAULT_CLIENT_SECRET:

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<AzureKeyVaultClientId>6a27a2da-bb78-4baa-bd2b-150fe89ea039</AzureKeyVaultClientId>
2727
<AzureKeyVaultClientSecret>$(KEYVAULT_CLIENT_SECRET)</AzureKeyVaultClientSecret>
2828
<CodeSignCertName>DigiCertCodeSign</CodeSignCertName>
29-
<CodeSign Condition=" '$(CI)' == 'true' ">true</CodeSign>
29+
<CodeSign>false</CodeSign>
3030

3131
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
3232
<GenerateFullPaths Condition="'$(VSCODE_PID)' != ''">true</GenerateFullPaths>

build.ps1

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ param(
44
[ValidateSet('Debug', 'Release')]
55
$Configuration = $null,
66
[switch]
7-
$IsOfficialBuild,
7+
$ci,
8+
[switch]
9+
$sign,
810
[Parameter(ValueFromRemainingArguments = $true)]
911
[string[]]$MSBuildArgs
1012
)
@@ -18,40 +20,44 @@ Import-Module -Force -Scope Local "$PSScriptRoot/src/common.psm1"
1820
# Main
1921
#
2022

23+
if ($env:CI -eq 'true') {
24+
$ci = $true
25+
}
26+
2127
if (!$Configuration) {
22-
$Configuration = if ($env:CI -or $IsOfficialBuild) { 'Release' } else { 'Debug' }
28+
$Configuration = if ($ci) { 'Release' } else { 'Debug' }
2329
}
2430

25-
if ($IsOfficialBuild) {
31+
if ($ci) {
2632
$MSBuildArgs += '-p:CI=true'
33+
}
2734

28-
$CodeSign = -not $env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT -and ($IsWindows -or -not $IsCoreCLR)
29-
30-
if ($CodeSign) {
31-
$astDir = "$PSScriptRoot/.build/tools/store/AzureSignTool/1.0.1/"
32-
$AzureSignToolPath = "$astDir/AzureSignTool.exe"
33-
if (-not (Test-Path $AzureSignToolPath)) {
34-
New-Item $astDir -ItemType Directory -ErrorAction Ignore | Out-Null
35-
Invoke-WebRequest https://github.com/vcsjones/AzureSignTool/releases/download/1.0.1/AzureSignTool.zip `
36-
-OutFile "$astDir/AzureSignTool.zip"
37-
Expand-Archive "$astDir/AzureSignTool.zip" -DestinationPath $astDir
38-
}
39-
40-
$nstDir = "$PSScriptRoot/.build/tools/store/NuGetKeyVaultSignTool/1.1.4/"
41-
$NuGetKeyVaultSignTool = "$nstDir/tools/net471/NuGetKeyVaultSignTool.exe"
42-
if (-not (Test-Path $NuGetKeyVaultSignTool)) {
43-
New-Item $nstDir -ItemType Directory -ErrorAction Ignore | Out-Null
44-
Invoke-WebRequest https://github.com/onovotny/NuGetKeyVaultSignTool/releases/download/v1.1.4/NuGetKeyVaultSignTool.1.1.4.nupkg `
45-
-OutFile "$nstDir/NuGetKeyVaultSignTool.zip"
46-
Expand-Archive "$nstDir/NuGetKeyVaultSignTool.zip" -DestinationPath $nstDir
47-
}
35+
$CodeSign = $sign -or ($ci -and -not $env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT -and ($IsWindows -or -not $IsCoreCLR))
4836

49-
$MSBuildArgs += "-p:AzureSignToolPath=$AzureSignToolPath"
50-
$MSBuildArgs += "-p:NuGetKeyVaultSignTool=$NuGetKeyVaultSignTool"
37+
if ($CodeSign) {
38+
$astDir = "$PSScriptRoot/.build/tools/store/AzureSignTool/1.0.1/"
39+
$AzureSignToolPath = "$astDir/AzureSignTool.exe"
40+
if (-not (Test-Path $AzureSignToolPath)) {
41+
New-Item $astDir -ItemType Directory -ErrorAction Ignore | Out-Null
42+
Invoke-WebRequest https://github.com/vcsjones/AzureSignTool/releases/download/1.0.1/AzureSignTool.zip `
43+
-OutFile "$astDir/AzureSignTool.zip"
44+
Expand-Archive "$astDir/AzureSignTool.zip" -DestinationPath $astDir
5145
}
52-
else {
53-
$MSBuildArgs += '-p:CodeSign=false'
46+
47+
$nstDir = "$PSScriptRoot/.build/tools/store/NuGetKeyVaultSignTool/1.1.4/"
48+
$NuGetKeyVaultSignTool = "$nstDir/tools/net471/NuGetKeyVaultSignTool.exe"
49+
if (-not (Test-Path $NuGetKeyVaultSignTool)) {
50+
New-Item $nstDir -ItemType Directory -ErrorAction Ignore | Out-Null
51+
Invoke-WebRequest https://github.com/onovotny/NuGetKeyVaultSignTool/releases/download/v1.1.4/NuGetKeyVaultSignTool.1.1.4.nupkg `
52+
-OutFile "$nstDir/NuGetKeyVaultSignTool.zip"
53+
Expand-Archive "$nstDir/NuGetKeyVaultSignTool.zip" -DestinationPath $nstDir
5454
}
55+
56+
$MSBuildArgs += "-p:AzureSignToolPath=$AzureSignToolPath"
57+
$MSBuildArgs += "-p:NuGetKeyVaultSignTool=$NuGetKeyVaultSignTool"
58+
}
59+
else {
60+
$MSBuildArgs += '-p:CodeSign=false'
5561
}
5662

5763
$artifacts = "$PSScriptRoot/artifacts/"

0 commit comments

Comments
 (0)