forked from openssh/openssh-portable
-
Notifications
You must be signed in to change notification settings - Fork 361
update CI to build vcpkg dependencies in separate stage #821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
build vcpkg dependencies in separate stage
- Loading branch information
commit 414a5dd8dca871a61b548ccc5ae5c6371fe2d5ce
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| parameters: | ||
| - name: triplet | ||
| type: string | ||
| - name: artifactSuffix | ||
| type: string | ||
|
|
||
| steps: | ||
| - pwsh: | | ||
| # Compare LibreSSL versions in vcpkg.json and add-resource-file.patch | ||
| $vcpkgObj = Get-Content "$(Build.SourcesDirectory)/contrib/win32/openssh/vcpkg.json" | ConvertFrom-Json | ||
| $libresslVersionJson = $vcpkgObj | Select-Object -ExpandProperty overrides | Where-Object { $_.name -eq 'libressl' } | Select-Object -ExpandProperty version | ||
| # resource file version needs to be trimmed (e.g. 4.0.0.0 to 4.0.0) | ||
| $patchContent = Get-Content "$(Build.SourcesDirectory)/contrib/win32/openssh/vcpkg_overlay_ports/libressl/add-version-file.patch" | ||
| $libresslVersionPatch = ($patchContent -join "`n" | Select-String -Pattern '"FileVersion",\s*"(\d+\.\d+\.\d+\.\d+)"' -AllMatches).Matches | ForEach-Object { $_.Groups[1].Value } | ||
| $libresslVersionPatchParts = $libresslVersionPatch -split '\.' | ||
| $libresslVersionPatchShort = ($libresslVersionPatchParts[0..2] -join '.') | ||
| if ($libresslVersionJson -ne $libresslVersionPatchShort) { | ||
| Write-Error "LibreSSL version mismatch: vcpkg.json has $libresslVersionJson, patch file has $libresslVersionPatch" | ||
| exit 1 | ||
| } else { | ||
| Write-Verbose -Verbose "LibreSSL versions match: $libresslVersionJson" | ||
| } | ||
| displayName: 'Verify version info' | ||
|
|
||
| - pwsh: |- | ||
| git clone https://github.com/microsoft/vcpkg | ||
| cd vcpkg | ||
| & ./bootstrap-vcpkg.bat | ||
| & ./vcpkg.exe integrate install | ||
tgauth marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| displayName: Install and bootstrap vcpkg | ||
|
|
||
| - pwsh: | | ||
| $triplet = '${{ parameters.triplet }}' | ||
| Write-Verbose -Verbose "Installing vcpkg dependencies for triplet: $triplet" | ||
| Push-Location "$(Build.SourcesDirectory)/contrib/win32/openssh" | ||
| try { | ||
| & "$(Build.SourcesDirectory)/vcpkg/vcpkg.exe" install --triplet $triplet --overlay-triplets=.\vcpkg_triplets --overlay-ports=.\vcpkg_overlay_ports | ||
| if ($LASTEXITCODE -ne 0) { | ||
| throw "vcpkg install failed with exit code $LASTEXITCODE" | ||
| } | ||
| } finally { | ||
| Pop-Location | ||
| } | ||
| displayName: Install vcpkg dependencies (${{ parameters.triplet }}) | ||
|
|
||
| - pwsh: | | ||
| $artifactSuffix = '${{ parameters.artifactSuffix }}' | ||
| $vcpkgInstalledPath = "$(Build.SourcesDirectory)/contrib/win32/openssh/vcpkg_installed" | ||
| if (Test-Path -Path $vcpkgInstalledPath) { | ||
| Write-Verbose -Verbose "vcpkg_installed directory contents:" | ||
| Get-ChildItem -Path $vcpkgInstalledPath -Recurse -Depth 2 | Select-Object -First 50 | ||
| # Upload vcpkg dependencies artifact | ||
| Write-Verbose -Verbose -Message "Uploading vcpkg dependencies artifact" | ||
| $artifactName = "vcpkg-dependencies-$artifactSuffix" | ||
| Write-Host "##vso[artifact.upload containerfolder=$artifactName;artifactname=$artifactName;]$vcpkgInstalledPath" | ||
| } else { | ||
| Write-Error "vcpkg_installed directory not found at: $vcpkgInstalledPath" | ||
| exit 1 | ||
| } | ||
| displayName: Upload vcpkg dependencies (${{ parameters.artifactSuffix }}) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.