mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
[Windows] Use default msys2 installer (#3819)
* Use default msys2 installer
* Use default msys2 installer
* Revert "[Windows] cargo-audit 0.15.0 is broken, stick to 0.14.1 (#3822)"
This reverts commit 0b37a50b57.
* merge
This commit is contained in:
committed by
GitHub
parent
799c7a79cf
commit
b28c62d3f1
@@ -8,43 +8,25 @@
|
|||||||
# https://packages.msys2.org/group/
|
# https://packages.msys2.org/group/
|
||||||
|
|
||||||
$dash = "-" * 40
|
$dash = "-" * 40
|
||||||
|
|
||||||
$origPath = $env:PATH
|
$origPath = $env:PATH
|
||||||
$gitPath = "$env:ProgramFiles\Git"
|
|
||||||
|
|
||||||
$msys2_release = "https://api.github.com/repos/msys2/msys2-installer/releases/latest"
|
$msys2_release = "https://api.github.com/repos/msys2/msys2-installer/releases/latest"
|
||||||
|
|
||||||
$msys2Uri = ((Invoke-RestMethod $msys2_release).assets | Where-Object {
|
$msys2Uri = ((Invoke-RestMethod $msys2_release).assets | Where-Object {
|
||||||
$_.name -match "x86_64" -and $_.name.EndsWith("tar.xz") }).browser_download_url
|
$_.name -match "^msys2-x86_64" -and $_.name.EndsWith(".exe") }).browser_download_url
|
||||||
|
|
||||||
# Download the latest msys2 x86_64, filename includes release date
|
# Download the latest msys2 x86_64, filename includes release date
|
||||||
Write-Host "Starting msys2 download using $($msys2Uri.split('/')[-1])"
|
Write-Host "Starting msys2 download using $($msys2Uri.split('/')[-1])"
|
||||||
$msys2File = Start-DownloadWithRetry -Url $msys2Uri
|
$msys2File = Start-DownloadWithRetry -Url $msys2Uri
|
||||||
Write-Host "Finished download"
|
Write-Host "Finished download"
|
||||||
|
|
||||||
# nix style path for tar
|
|
||||||
$msys2FileU = "/$msys2File".replace(':', '').replace('\', '/')
|
|
||||||
|
|
||||||
# Git tar needs exe's from mingw64\bin
|
|
||||||
$env:PATH = "$gitPath\usr\bin;$gitPath\mingw64\bin;$origPath"
|
|
||||||
|
|
||||||
$tar = "$gitPath\usr\bin\tar.exe"
|
|
||||||
|
|
||||||
# extract tar.xz to C:\
|
# extract tar.xz to C:\
|
||||||
Write-Host "Starting msys2 extraction"
|
Write-Host "Starting msys2 installation"
|
||||||
&$tar -xJf $msys2FileU -C /c/
|
& $msys2File in --confirm-command --accept-messages --root C:/msys64
|
||||||
Remove-Item $msys2File
|
Remove-Item $msys2File
|
||||||
Write-Host "Finished extraction"
|
|
||||||
|
|
||||||
# Add msys2 bin tools folders to PATH temporary
|
# Add msys2 bin tools folders to PATH temporary
|
||||||
$env:PATH = "C:\msys64\mingw64\bin;C:\msys64\usr\bin;$origPath"
|
$env:PATH = "C:\msys64\mingw64\bin;C:\msys64\usr\bin;$origPath"
|
||||||
|
|
||||||
Write-Host "`n$dash bash pacman-key --init"
|
|
||||||
bash.exe -c "pacman-key --init 2>&1"
|
|
||||||
|
|
||||||
Write-Host "bash pacman-key --populate msys2"
|
|
||||||
bash.exe -c "pacman-key --populate msys2 2>&1"
|
|
||||||
|
|
||||||
Write-Host "`n$dash pacman --noconfirm -Syyuu"
|
Write-Host "`n$dash pacman --noconfirm -Syyuu"
|
||||||
pacman.exe -Syyuu --noconfirm
|
pacman.exe -Syyuu --noconfirm
|
||||||
taskkill /f /fi "MODULES eq msys-2.0.dll"
|
taskkill /f /fi "MODULES eq msys-2.0.dll"
|
||||||
@@ -53,7 +35,6 @@ pacman.exe -Syuu --noconfirm
|
|||||||
taskkill /f /fi "MODULES eq msys-2.0.dll"
|
taskkill /f /fi "MODULES eq msys-2.0.dll"
|
||||||
|
|
||||||
$toolsetContent = (Get-ToolsetContent).MsysPackages
|
$toolsetContent = (Get-ToolsetContent).MsysPackages
|
||||||
|
|
||||||
Write-Host "`n$dash Install msys2 packages"
|
Write-Host "`n$dash Install msys2 packages"
|
||||||
$msys2Packages = $toolsetContent.msys2
|
$msys2Packages = $toolsetContent.msys2
|
||||||
pacman.exe -S --noconfirm --needed --noprogressbar $msys2Packages
|
pacman.exe -S --noconfirm --needed --noprogressbar $msys2Packages
|
||||||
|
|||||||
Reference in New Issue
Block a user