@@ -14,109 +14,32 @@ stages:
1414- stage : Build
1515 displayName : Build Win32-OpenSSH
1616 jobs :
17- - job : BuildPkg
18- displayName : Build Package
17+ - job : BuildPkg_x64
18+ displayName : Build Package (x64)
1919 pool :
2020 name : PS-PowerShell-x64
2121 demands :
2222 - ImageOverride -equals PSMMS2022-OpenSSH-Secure
23-
2423 steps :
25- - pwsh : |
26- # Compare LibreSSL versions in vcpkg.json and add-resource-file.patch
27- $vcpkgObj = Get-Content "$(Build.SourcesDirectory)/contrib/win32/openssh/vcpkg.json" | ConvertFrom-Json
28- $libresslVersionJson = $vcpkgObj | Select-Object -ExpandProperty overrides | Where-Object { $_.name -eq 'libressl' } | Select-Object -ExpandProperty version
29-
30- # resource file version needs to be trimmed (e.g. 4.0.0.0 to 4.0.0)
31- $patchContent = Get-Content "$(Build.SourcesDirectory)/contrib/win32/openssh/vcpkg_overlay_ports/libressl/add-version-file.patch"
32- $libresslVersionPatch = ($patchContent -join "`n" | Select-String -Pattern '"FileVersion",\s*"(\d+\.\d+\.\d+\.\d+)"' -AllMatches).Matches | ForEach-Object { $_.Groups[1].Value }
33- $libresslVersionPatchParts = $libresslVersionPatch -split '\.'
34- $libresslVersionPatchShort = ($libresslVersionPatchParts[0..2] -join '.')
35-
36- if ($libresslVersionJson -ne $libresslVersionPatchShort) {
37- Write-Error "LibreSSL version mismatch: vcpkg.json has $libresslVersionJson, patch file has $libresslVersionPatch"
38- exit 1
39- } else {
40- Write-Verbose -Verbose "LibreSSL versions match: $libresslVersionJson"
41- }
42- displayName: 'Verify version info'
43-
44- - pwsh : |-
45- git clone https://github.com/microsoft/vcpkg
46- cd vcpkg
47- & ./bootstrap-vcpkg.bat
48- & ./vcpkg.exe integrate install
49- displayName: Install vcpkg
50-
51- - pwsh : |
52- Import-Module -Name "$(Build.SourcesDirectory)/contrib/win32/openssh/AzDOBuildTools" -Force
53- Invoke-AzDOBuild
54- displayName: Build Win32-OpenSSH
55-
56- - pwsh : |
57- $BuildOutPath = "$(Build.SourcesDirectory)/bin"
58- $BuildOutx86Path = Join-Path -Path $BuildOutPath -ChildPath 'Win32/Release'
59- Get-ChildItem -Path $BuildOutx86Path
60- $BuildOutx64Path = Join-Path -Path $BuildOutPath -ChildPath 'x64/Release'
61- Get-ChildItem -Path $BuildOutx64Path
62- displayName: Capture build results
63-
64- - pwsh : |
65- Import-Module -Name "$(Build.SourcesDirectory)/contrib/win32/openssh/AzDOBuildTools" -Force
66- #
67- # Copy build artifacts
68- $BuildDestPath = "$(Build.SourcesDirectory)/Win32-OpenSSH"
69- if (Test-Path -Path $BuildDestPath) {
70- Remove-Item -Path $BuildDestPath -Recurse -Force -ErrorAction SilentlyContinue
71- }
72- $null = New-Item -ItemType Directory -Path $BuildDestPath -Force
73- $BuildDestx86Path = Join-Path -Path $BuildDestPath -ChildPath 'x86/Release'
74- Copy-BuildResults -BuildResultsPath $BuildDestx86Path -NativeHostArch x86 -Configuration Release
75- $BuildDestX64Path = Join-Path -Path $BuildDestPath -ChildPath 'x64/Release'
76- Copy-BuildResults -BuildResultsPath $BuildDestx64Path -NativeHostArch x64 -Configuration Release
77- #
78- # Upload build artifacts
79- Write-Verbose -Verbose -Message "Uploading build artifacts"
80- $artifactName = 'Win32-OpenSSH'
81- Write-Host "##vso[artifact.upload containerfolder=$artifactName;artifactname=$artifactName;]$BuildDestPath"
82- #
83- # Copy unit tests
84- $BuildOutPath = "$(Build.SourcesDirectory)/bin"
85- $UnitTestDestPath = "$(Build.SourcesDirectory)/UnitTests"
86- Copy-UnitTests -UnitTestsSrcDir $BuildOutPath -UnitTestsDestDir $UnitTestDestPath -NativeHostArch x86 -Configuration Release
87- Copy-UnitTests -UnitTestsSrcDir $BuildOutPath -UnitTestsDestDir $UnitTestDestPath -NativeHostArch x64 -Configuration Release
88- #
89- # Upload unit test artifacts
90- Write-Verbose -Verbose -Message "Uploading unit test artifacts"
91- $artifactName = 'UnitTests'
92- Write-Host "##vso[artifact.upload containerfolder=$artifactName;artifactname=$artifactName;]$UnitTestDestPath"
93- #
94- # Upload bash tests config.h file
95- Write-Verbose -Verbose -Message "Uploading config.h file for bash tests"
96- $artifactName = 'ConfigFile'
97- $configFilePath = "$(Build.SourcesDirectory)/config.h"
98- Write-Host "##vso[artifact.upload containerfolder=$artifactName;artifactname=$artifactName;]$configFilePath"
99- displayName: Upload Win32-OpenSSH build artifacts
100-
101- - pwsh : |
102- $logFileNames = @("OpenSSHReleasex64.log", "OpenSSHReleasex86.log")
103- $uniqueLines = [System.Collections.Generic.HashSet[string]]::new()
104- forEach ($logFile in $logFileNames) {
105- $logFilePath = "$(Build.SourcesDirectory)/contrib/win32/openssh/$logFile"
106- $logLines = Get-Content $logFilePath
107- $buildSucceededIndex = $logLines.IndexOf("Build succeeded.")
108- $linesToCheck = $logLines[($buildSucceededIndex + 1)..$logLines.Length]
109- forEach ($line in $linesToCheck) {
110- if ($line -match "warning C") {
111- $uniqueLines.Add($line) | Out-Null
112- }
113- }
114- }
115- forEach ($uniqueLine in $uniqueLines) {
116- Write-Output $uniqueLine
117- Write-Host "##vso[task.logissue type=warning]$uniqueLine"
118- }
119- displayName: Surface Warnings from Build Logs
24+ - template : ./templates/build-win32-openssh-job.yml
25+ parameters :
26+ nativeHostArch : x64
27+ buildOutputDir : x64
28+ artifactSuffix : x64
29+ includeConfig : true
30+
31+ - job : BuildPkg_x86
32+ displayName : Build Package (x86)
33+ pool :
34+ name : PS-PowerShell-x64
35+ demands :
36+ - ImageOverride -equals PSMMS2022-OpenSSH-Secure
37+ steps :
38+ - template : ./templates/build-win32-openssh-job.yml
39+ parameters :
40+ nativeHostArch : x86
41+ buildOutputDir : Win32
42+ artifactSuffix : x86
12043
12144- stage : Test
12245 displayName : Test Win32-OpenSSH
@@ -134,23 +57,23 @@ stages:
13457 inputs :
13558 buildType : current
13659 downloadType : single
137- artifactName : Win32-OpenSSH
60+ artifactName : Win32-OpenSSH-x64
13861 downloadPath : ' $(System.ArtifactsDirectory)'
13962
14063 - task : DownloadBuildArtifacts@0
14164 displayName : ' Download unit test artifacts'
14265 inputs :
14366 buildType : current
14467 downloadType : single
145- artifactName : UnitTests
68+ artifactName : UnitTests-x64
14669 downloadPath : ' $(System.ArtifactsDirectory)'
14770
14871 - task : DownloadBuildArtifacts@0
14972 displayName : ' Download bash test config file artifact'
15073 inputs :
15174 buildType : current
15275 downloadType : single
153- artifactName : ConfigFile
76+ artifactName : ConfigFile-x64
15477 downloadPath : ' $(System.ArtifactsDirectory)'
15578
15679 - pwsh : |
@@ -161,16 +84,16 @@ stages:
16184
16285 - pwsh : |
16386 Import-Module -Name "$(Build.SourcesDirectory)/contrib/win32/openssh/AzDOBuildTools" -Force
164- Install-OpenSSH -SourceDir "$(System.ArtifactsDirectory)/Win32-OpenSSH/x64/Release" -OpenSSHDir "$env:SystemDrive/OpenSSH" -Verbose
87+ Install-OpenSSH -SourceDir "$(System.ArtifactsDirectory)/Win32-OpenSSH-x64 /x64/Release" -OpenSSHDir "$env:SystemDrive/OpenSSH" -Verbose
16588 displayName: Install Win32-OpenSSH
16689
16790 - pwsh : |
16891 Import-Module -Name "$(Build.SourcesDirectory)/contrib/win32/openssh/AzDOBuildTools" -Force
169- Install-UnitTests -SourceDir "$(System.ArtifactsDirectory)/UnitTests/x64/Release" -OpenSSHDir "$env:SystemDrive/OpenSSH" -Verbose
92+ Install-UnitTests -SourceDir "$(System.ArtifactsDirectory)/UnitTests-x64 /x64/Release" -OpenSSHDir "$env:SystemDrive/OpenSSH" -Verbose
17093 displayName: Install Unit Tests
17194
17295 - pwsh : |
173- $configFileSrc = "$(System.ArtifactsDirectory)/ConfigFile/config.h"
96+ $configFileSrc = "$(System.ArtifactsDirectory)/ConfigFile-x64 /config.h"
17497 $configFileDest = "$(Build.SourcesDirectory)"
17598 Write-Verbose -Verbose -Message "Copying config file from: ${configFileSrc} to: ${configFileDest}"
17699 Copy-Item -Path $configFileSrc -Dest $configFileDest -Force
0 commit comments