mirror of
https://github.com/actions/runner-images.git
synced 2025-12-20 06:35:47 +00:00
Switch Expand-Archive to 7zip on Windows image generation (#861)
* switch expand-archive to 7zip on windows
This commit is contained in:
committed by
GitHub
parent
ffa2110464
commit
3e9c8e5afc
@@ -15,7 +15,7 @@ function Install-GoVersion
|
||||
[Switch] $addToDefaultPath
|
||||
)
|
||||
|
||||
$latestVersionObject = $refsJson | Where-Object { $_.ref -Match "refs/tags/go$goVersion[./d]*" } | Select-Object -Last 1
|
||||
$latestVersionObject = $refsJson | Where-Object { $_.ref -Match "refs/tags/go$goVersion[./d]*" } | Select-Object -Last 1
|
||||
$latestVersion = $latestVersionObject.ref.replace('refs/tags/go','')
|
||||
|
||||
# Download the Go zip archive.
|
||||
@@ -30,7 +30,7 @@ function Install-GoVersion
|
||||
# Extract the zip archive. It contains a single directory named "go".
|
||||
Write-Host "Extracting Go $latestVersion..."
|
||||
$toolDirectory = Join-Path $env:AGENT_TOOLSDIRECTORY "go\$latestVersion"
|
||||
7z.exe x $goArchPath -o"$toolDirectory" -y | Out-Null
|
||||
Extract-7Zip -Path $goArchPath -DestinationPath $toolDirectory
|
||||
|
||||
# Rename the extracted "go" directory to "x64" for full path "C:\hostedtoolcache\windows\Go\1.14.2\x64\..."
|
||||
Rename-Item -path "$toolDirectory\go" -newName "x64"
|
||||
|
||||
Reference in New Issue
Block a user