mirror of
https://github.com/actions/runner-images.git
synced 2025-12-16 06:40:32 +00:00
Switch provisioners to install Boost from GitHub releases on Windows (#972)
* switch provisioners to install boost from github releases * minor fixes * separate boosts by toolset versions * minor fix * switch provisioners for win16 * fix bugs * fix validation * minor fix * fix validation * fix validation * fix validation * minor fix * change toolset version for win16 * minor fixes * minor fix * fix validation * update links to toolset-json * add arch to BoostInstallationDir
This commit is contained in:
committed by
GitHub
parent
a0b45fba7a
commit
f33a870bf1
@@ -612,7 +612,8 @@
|
|||||||
{
|
{
|
||||||
"type": "powershell",
|
"type": "powershell",
|
||||||
"environment_vars": [
|
"environment_vars": [
|
||||||
"ROOT_FOLDER={{user `root_folder`}}"
|
"ROOT_FOLDER={{user `root_folder`}}",
|
||||||
|
"TOOLSET_JSON_PATH={{user `toolset_json_path`}}"
|
||||||
],
|
],
|
||||||
"scripts":[
|
"scripts":[
|
||||||
"{{ template_dir }}/scripts/Installers/Install-Boost.ps1"
|
"{{ template_dir }}/scripts/Installers/Install-Boost.ps1"
|
||||||
@@ -782,15 +783,6 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Validate-Go.ps1"
|
"{{ template_dir }}/scripts/Installers/Validate-Go.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "powershell",
|
|
||||||
"environment_vars": [
|
|
||||||
"ROOT_FOLDER={{user `root_folder`}}"
|
|
||||||
],
|
|
||||||
"scripts":[
|
|
||||||
"{{ template_dir }}/scripts/Installers/Validate-Boost.ps1"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "powershell",
|
"type": "powershell",
|
||||||
"scripts":[
|
"scripts":[
|
||||||
|
|||||||
@@ -573,7 +573,8 @@
|
|||||||
{
|
{
|
||||||
"type": "powershell",
|
"type": "powershell",
|
||||||
"environment_vars": [
|
"environment_vars": [
|
||||||
"ROOT_FOLDER={{user `root_folder`}}"
|
"ROOT_FOLDER={{user `root_folder`}}",
|
||||||
|
"TOOLSET_JSON_PATH={{user `toolset_json_path`}}"
|
||||||
],
|
],
|
||||||
"scripts":[
|
"scripts":[
|
||||||
"{{ template_dir }}/scripts/Installers/Install-Boost.ps1"
|
"{{ template_dir }}/scripts/Installers/Install-Boost.ps1"
|
||||||
@@ -767,15 +768,6 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Validate-Go.ps1"
|
"{{ template_dir }}/scripts/Installers/Validate-Go.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "powershell",
|
|
||||||
"environment_vars": [
|
|
||||||
"ROOT_FOLDER={{user `root_folder`}}"
|
|
||||||
],
|
|
||||||
"scripts":[
|
|
||||||
"{{ template_dir }}/scripts/Installers/Validate-Boost.ps1"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "powershell",
|
"type": "powershell",
|
||||||
"scripts":[
|
"scripts":[
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ Import-Module -Name ImageHelpers
|
|||||||
|
|
||||||
$SoftwareName = "Boost"
|
$SoftwareName = "Boost"
|
||||||
$BoostDirectory = Join-Path -Path $env:AGENT_TOOLSDIRECTORY -ChildPath $SoftwareName
|
$BoostDirectory = Join-Path -Path $env:AGENT_TOOLSDIRECTORY -ChildPath $SoftwareName
|
||||||
$BoostVersions = (Get-ToolsByName -SoftwareName $SoftwareName).Versions | Foreach-Object {"{0}.0" -f $_}
|
$BoostVersions = (Get-ToolsetContent | Select-Object -ExpandProperty toolcache | Where-Object { $_.Name -eq "Boost"}).Versions
|
||||||
|
|
||||||
foreach($BoostVersion in $BoostVersions)
|
foreach($BoostVersion in $BoostVersions)
|
||||||
{
|
{
|
||||||
$BoostInstallationDir = Join-Path -Path $BoostDirectory -ChildPath $BoostVersion
|
$BoostInstallationDir = Join-Path -Path $BoostDirectory -ChildPath "$BoostVersion\X86_64"
|
||||||
|
|
||||||
$EnvBoostPath = "BOOST_ROOT_{0}" -f ($BoostVersion.Replace('.', '_'))
|
$EnvBoostPath = "BOOST_ROOT_{0}" -f ($BoostVersion.Replace('.', '_'))
|
||||||
setx $EnvBoostPath $BoostInstallationDir /M | Out-Null
|
setx $EnvBoostPath $BoostInstallationDir /M | Out-Null
|
||||||
|
|||||||
@@ -15,7 +15,13 @@ Function Install-Asset {
|
|||||||
$assetArchivePath = Start-DownloadWithRetry -Url $ReleaseAsset.download_url -Name $ReleaseAsset.filename
|
$assetArchivePath = Start-DownloadWithRetry -Url $ReleaseAsset.download_url -Name $ReleaseAsset.filename
|
||||||
|
|
||||||
Write-Host "Extract $($ReleaseAsset.filename) content..."
|
Write-Host "Extract $($ReleaseAsset.filename) content..."
|
||||||
7z.exe x $assetArchivePath -o"$assetFolderPath" -y | Out-Null
|
if ($assetArchivePath.EndsWith(".tar.gz")) {
|
||||||
|
$assetTarPath = $assetArchivePath.TrimEnd(".tar.gz")
|
||||||
|
Extract-7Zip -Path $assetArchivePath -DestinationPath $assetTarPath
|
||||||
|
Extract-7Zip -Path $assetTarPath -DestinationPath $assetFolderPath
|
||||||
|
} else {
|
||||||
|
Extract-7Zip -Path $assetArchivePath -DestinationPath $assetFolderPath
|
||||||
|
}
|
||||||
|
|
||||||
Write-Host "Invoke installation script..."
|
Write-Host "Invoke installation script..."
|
||||||
Push-Location -Path $assetFolderPath
|
Push-Location -Path $assetFolderPath
|
||||||
@@ -48,7 +54,7 @@ $ErrorActionPreference = "Stop"
|
|||||||
Import-Module -Name ImageHelpers -Force
|
Import-Module -Name ImageHelpers -Force
|
||||||
|
|
||||||
# Get toolcache content from toolset
|
# Get toolcache content from toolset
|
||||||
$ToolsToInstall = @("Python", "Node")
|
$ToolsToInstall = @("Python", "Node", "Boost")
|
||||||
$tools = Get-ToolsetContent | Select-Object -ExpandProperty toolcache | Where {$ToolsToInstall -contains $_.Name}
|
$tools = Get-ToolsetContent | Select-Object -ExpandProperty toolcache | Where {$ToolsToInstall -contains $_.Name}
|
||||||
|
|
||||||
foreach ($tool in $tools) {
|
foreach ($tool in $tools) {
|
||||||
@@ -60,7 +66,7 @@ foreach ($tool in $tools) {
|
|||||||
$asset = $assets | Where-Object version -like $toolVersion `
|
$asset = $assets | Where-Object version -like $toolVersion `
|
||||||
| Sort-Object -Property {[version]$_.version} -Descending `
|
| Sort-Object -Property {[version]$_.version} -Descending `
|
||||||
| Select-Object -ExpandProperty files `
|
| Select-Object -ExpandProperty files `
|
||||||
| Where-Object { ($_.platform -eq $tool.platform) -and ($_.arch -eq $tool.arch) } `
|
| Where-Object { ($_.platform -eq $tool.platform) -and ($_.arch -eq $tool.arch) -and ($_.toolset -eq $tool.toolset) } `
|
||||||
| Select-Object -First 1
|
| Select-Object -First 1
|
||||||
|
|
||||||
Write-Host "Installing $($tool.name) $toolVersion $($tool.arch)..."
|
Write-Host "Installing $($tool.name) $toolVersion $($tool.arch)..."
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
################################################################################
|
|
||||||
## File: Validate-Boost.ps1
|
|
||||||
## Desc: Validate Boost
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
Import-Module -Name ImageHelpers
|
|
||||||
|
|
||||||
function Validate-BoostVersion
|
|
||||||
{
|
|
||||||
Param
|
|
||||||
(
|
|
||||||
[String]$BoostRootPath,
|
|
||||||
[String]$BoostRelease
|
|
||||||
)
|
|
||||||
|
|
||||||
$ReleasePath = Join-Path -Path $BoostRootPath -ChildPath $BoostRelease
|
|
||||||
|
|
||||||
if (Test-Path "$ReleasePath\b2.exe")
|
|
||||||
{
|
|
||||||
Write-Host "Boost.Build $BoostRelease is successfully installed"
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "$BoostRelease not found"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
$SoftwareName = 'Boost'
|
|
||||||
$BoostRootDirectory = Join-Path -Path $env:AGENT_TOOLSDIRECTORY -ChildPath $SoftwareName
|
|
||||||
$BoostTools = Get-ToolsByName -SoftwareName $SoftwareName
|
|
||||||
|
|
||||||
foreach ($BoostTool in $BoostTools)
|
|
||||||
{
|
|
||||||
$BoostVersionsToInstall = $BoostTool.Versions | Foreach-Object {"{0}.0" -f $_}
|
|
||||||
foreach($BoostVersion in $BoostVersionsToInstall)
|
|
||||||
{
|
|
||||||
Validate-BoostVersion -BoostRootPath $BoostRootDirectory -BoostRelease $BoostVersion
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -67,8 +67,8 @@ foreach($tool in $tools) {
|
|||||||
|
|
||||||
foreach ($version in $tool.versions) {
|
foreach ($version in $tool.versions) {
|
||||||
# Add wildcard if missing
|
# Add wildcard if missing
|
||||||
if (-not $version.Contains('*')) {
|
if ($version.Split(".").Length -lt 3) {
|
||||||
$version += '.*'
|
$version += ".*"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check if version folder exists
|
# Check if version folder exists
|
||||||
@@ -90,8 +90,10 @@ foreach($tool in $tools) {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host "Run validation test for $($tool.name)($($tool.arch)) $($foundVersion.name) executables..."
|
if ($toolExecs) {
|
||||||
Run-ExecutableTests -Executables $toolExecs -ToolPath $foundVersionArchPath
|
Write-Host "Run validation test for $($tool.name)($($tool.arch)) $($foundVersion.name) executables..."
|
||||||
|
Run-ExecutableTests -Executables $toolExecs -ToolPath $foundVersionArchPath
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (-not ([string]::IsNullOrEmpty($tool.default))) {
|
if (-not ([string]::IsNullOrEmpty($tool.default))) {
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
{
|
{
|
||||||
"@actions/toolcache-ruby-windows-x64": [
|
"@actions/toolcache-ruby-windows-x64": [
|
||||||
"2.4", "2.5", "2.6", "2.7"
|
"2.4", "2.5", "2.6", "2.7"
|
||||||
],
|
|
||||||
"@actions/toolcache-boost-windows-msvc-14.1-x32-x64": [
|
|
||||||
"1.69", "1.72"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,5 @@
|
|||||||
{
|
{
|
||||||
"@actions/toolcache-ruby-windows-x64": [
|
"@actions/toolcache-ruby-windows-x64": [
|
||||||
"2.4", "2.5", "2.6", "2.7"
|
"2.4", "2.5", "2.6", "2.7"
|
||||||
],
|
|
||||||
"@actions/toolcache-boost-windows-msvc-14.1-x32-x64": [
|
|
||||||
"1.69"
|
|
||||||
],
|
|
||||||
"@actions/toolcache-boost-windows-msvc-14.2-x32-x64": [
|
|
||||||
"1.72"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -47,6 +47,17 @@
|
|||||||
"12.*",
|
"12.*",
|
||||||
"14.*"
|
"14.*"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Boost",
|
||||||
|
"url" : "https://raw.githubusercontent.com/actions/boost-versions/master/versions-manifest.json",
|
||||||
|
"arch": "x86_64",
|
||||||
|
"platform" : "win32",
|
||||||
|
"toolset": "msvc14.1",
|
||||||
|
"versions": [
|
||||||
|
"1.69.0",
|
||||||
|
"1.72.0"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -47,6 +47,26 @@
|
|||||||
"12.*",
|
"12.*",
|
||||||
"14.*"
|
"14.*"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Boost",
|
||||||
|
"url" : "https://raw.githubusercontent.com/akv-platform/boost-hostedtoolcache/master/versions-manifest.json",
|
||||||
|
"arch": "x86_64",
|
||||||
|
"platform" : "win32",
|
||||||
|
"toolset": "msvc14.1",
|
||||||
|
"versions": [
|
||||||
|
"1.69.0"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Boost",
|
||||||
|
"url" : "https://raw.githubusercontent.com/actions/boost-versions/master/versions-manifest.json",
|
||||||
|
"arch": "x86_64",
|
||||||
|
"platform" : "win32",
|
||||||
|
"toolset": "msvc14.2",
|
||||||
|
"versions": [
|
||||||
|
"1.72.0"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user