mirror of
https://github.com/actions/runner-images.git
synced 2025-12-19 08:22:12 +00:00
Install Stack, GHC and Cabal to Windows Images (#874)
* install stack * implement logic that gets 3 latest versions of ghc
This commit is contained in:
committed by
GitHub
parent
89b403d60a
commit
5160bfa626
20
images/win/scripts/Installers/Install-Stack.ps1
Normal file
20
images/win/scripts/Installers/Install-Stack.ps1
Normal file
@@ -0,0 +1,20 @@
|
||||
################################################################################
|
||||
## File: Install-Stack.ps1
|
||||
## Desc: Install Stack for Windows
|
||||
################################################################################
|
||||
|
||||
Write-Host "Get the latest Stack version..."
|
||||
$StackReleasesJson = Invoke-RestMethod "https://api.github.com/repos/commercialhaskell/stack/releases/latest"
|
||||
$DownloadFilePattern = "windows-x86_64.zip"
|
||||
$DownloadUrl = $StackReleasesJson.assets | Where-Object { $_.name.EndsWith($DownloadFilePattern) } | Select-Object -ExpandProperty "browser_download_url" -First 1
|
||||
|
||||
Write-Host "Download stack archive"
|
||||
$DestinationPath = Join-Path $Env:AGENT_TOOLSDIRECTORY "stack\x64"
|
||||
$StackArchivePath = Start-DownloadWithRetry -Url $DownloadUrl
|
||||
|
||||
Write-Host "Expand stack archive"
|
||||
Extract-7Zip -Path $StackArchivePath -DestinationPath $DestinationPath
|
||||
|
||||
New-Item -Name "x64.complete" -Path $DestinationPath
|
||||
|
||||
Add-MachinePathItem -PathItem $DestinationPath
|
||||
Reference in New Issue
Block a user