|
17 | 17 | - name: branchCounter |
18 | 18 | value: $[counter(variables['branchCounterKey'], 1)] |
19 | 19 | - group: DotNetPrivateBuildAccess |
| 20 | + - group: Azure Blob variable group |
| 21 | + - group: ReleasePipelineSecrets |
| 22 | + - group: AzDevOpsArtifacts |
20 | 23 |
|
21 | 24 | pool: |
22 | 25 | name: PowerShell1ES |
|
33 | 36 | CreateJson: yes |
34 | 37 | UseJson: no |
35 | 38 |
|
| 39 | + - template: ../insert-nuget-config-azfeed.yml |
| 40 | + parameters: |
| 41 | + repoRoot: '$(Build.SourcesDirectory)' |
| 42 | + |
36 | 43 | - pwsh: | |
37 | 44 | Import-Module .\build.psm1 -force |
38 | 45 | Start-PSBootstrap |
|
52 | 59 | displayName: Install dotnet-symbol |
53 | 60 | retryCountOnTaskFailure: 2 |
54 | 61 |
|
| 62 | + - pwsh: | |
| 63 | + Import-module '$(BUILD.SOURCESDIRECTORY)/build.psm1' |
| 64 | + Install-AzCopy |
| 65 | + displayName: Install AzCopy |
| 66 | + retryCountOnTaskFailure: 2 |
| 67 | +
|
| 68 | + - pwsh: | |
| 69 | + Import-module '$(BUILD.SOURCESDIRECTORY)/build.psm1' |
| 70 | + $azcopy = Find-AzCopy |
| 71 | + Write-Verbose -Verbose "Found AzCopy: $azcopy" |
| 72 | +
|
| 73 | + $winverifySymbolsPath = New-Item -ItemType Directory -Path '$(System.ArtifactsDirectory)/winverify-symbols' -Force |
| 74 | + Write-Host "##vso[task.setvariable variable=winverifySymbolsPath]$winverifySymbolsPath" |
| 75 | +
|
| 76 | + & $azcopy cp https://$(StorageAccount).blob.core.windows.net/winverify-private $winverifySymbolsPath --recursive |
| 77 | +
|
| 78 | + Get-ChildItem $winverifySymbolsPath -Recurse | Out-String | Write-Verbose -Verbose |
| 79 | +
|
| 80 | + displayName: Download winverify-private Artifacts |
| 81 | + retryCountOnTaskFailure: 2 |
| 82 | + env: |
| 83 | + AZCOPY_AUTO_LOGIN_TYPE: MSI |
| 84 | +
|
55 | 85 | - pwsh: | |
56 | 86 | Import-Module .\build.psm1 -force |
57 | 87 | Find-DotNet |
|
64 | 94 | if (Test-Path $OutputFolder/ref) { |
65 | 95 | Remove-Item -Recurse -Force $OutputFolder/ref |
66 | 96 | } |
| 97 | +
|
| 98 | + $surrogateFileTemplate = @' |
| 99 | + <?xml version="1.0" encoding="utf-8"?> |
| 100 | + <APIScanSurrogates> |
| 101 | + <Mappings> |
| 102 | + <Mapping> |
| 103 | + <SurrogateSet> |
| 104 | + <BinarySet> |
| 105 | + <SymbolLocations> |
| 106 | + <SymbolLocation>{path_to_symbol}</SymbolLocation> |
| 107 | + </SymbolLocations> |
| 108 | + <Binary path="{path_to_dll}" /> |
| 109 | + </BinarySet> |
| 110 | + </SurrogateSet> |
| 111 | + <Targets> |
| 112 | + <Binary path="{path_to_dll_in_build}" /> |
| 113 | + </Targets> |
| 114 | + </Mapping> |
| 115 | + </Mappings> |
| 116 | + </APIScanSurrogates> |
| 117 | + '@ |
| 118 | +
|
| 119 | + $pathToDll = Get-ChildItem -Path $OutputFolder -Filter 'getfilesiginforedist.dll' -Recurse | Where-Object { $_.fullname -like '*win-x64*' } | Select-Object -First 1 -ExpandProperty FullName |
| 120 | +
|
| 121 | + $surrogateFile = Join-Path $(Pipeline.Workspace) 'APIScanSurrogates.xml' |
| 122 | + $surrogateFileContent = $surrogateFileTemplate -replace '{path_to_symbol}', '$(winverifySymbolsPath)\winverify-private' -replace '{path_to_dll}', '$(winverifySymbolsPath)\winverify-private\getfilesiginforedist.dll' -replace '{path_to_dll_in_build}', $pathToDll |
| 123 | + $surrogateFileContent | Out-File -FilePath $surrogateFile -Force |
| 124 | +
|
| 125 | + Write-Verbose -Verbose -Message "Surrogate file content:" |
| 126 | + Get-Content -Path $surrogateFile -Raw | Out-String | Write-Verbose -Verbose |
| 127 | +
|
| 128 | + Write-Host "##vso[task.setvariable variable=surrogateFilePath]$(Pipeline.Workspace)" |
| 129 | +
|
67 | 130 | workingDirectory: '$(Build.SourcesDirectory)' |
68 | 131 | displayName: 'Build PowerShell Source' |
69 | 132 |
|
@@ -117,6 +180,7 @@ jobs: |
117 | 180 | verbosityLevel: standard |
118 | 181 | # write a status update every 5 minutes. Default is 1 minute |
119 | 182 | statusUpdateInterval: '00:05:00' |
| 183 | + surrogateConfigurationFolder : $(surrogateFilePath) |
120 | 184 | env: |
121 | 185 | AzureServicesAuthConnectionString: RunAs=App;AppId=$(APIScanClient);TenantId=$(APIScanTenant);AppKey=$(APIScanSecret) |
122 | 186 |
|
|
0 commit comments