mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 22:26:56 +00:00
Fix Stack's installation path (#896)
* fix path * fix naming * add ghc to path
This commit is contained in:
committed by
GitHub
parent
d7a86d8500
commit
1877f7df5e
@@ -15,5 +15,10 @@ ForEach ($version in $VersionsList)
|
||||
Choco-Install -PackageName ghc -ArgumentList "--version", $version, "-m"
|
||||
}
|
||||
|
||||
# Add default version of GHC to path, because choco formula updates path on user level
|
||||
$DefaultGhcVersion = $VersionsList | Select-Object -Last 1
|
||||
$DefaultGhcPath = Join-Path $env:ChocolateyInstall "lib\ghc.$DefaultGhcVersion\tools\ghc-$DefaultGhcVersion\bin"
|
||||
Add-MachinePathItem -PathItem $DefaultGhcPath
|
||||
|
||||
Write-Host "Installing cabal..."
|
||||
Choco-Install -PackageName cabal
|
||||
|
||||
@@ -5,16 +5,18 @@
|
||||
|
||||
Write-Host "Get the latest Stack version..."
|
||||
$StackReleasesJson = Invoke-RestMethod "https://api.github.com/repos/commercialhaskell/stack/releases/latest"
|
||||
$Version = $StackReleasesJson.name.TrimStart("v")
|
||||
$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"
|
||||
$StackToolcachePath = Join-Path $Env:AGENT_TOOLSDIRECTORY "stack\$Version"
|
||||
$DestinationPath = Join-Path $StackToolcachePath "x64"
|
||||
$StackArchivePath = Start-DownloadWithRetry -Url $DownloadUrl
|
||||
|
||||
Write-Host "Expand stack archive"
|
||||
Extract-7Zip -Path $StackArchivePath -DestinationPath $DestinationPath
|
||||
|
||||
New-Item -Name "x64.complete" -Path $DestinationPath
|
||||
New-Item -Name "x64.complete" -Path $StackToolcachePath
|
||||
|
||||
Add-MachinePathItem -PathItem $DestinationPath
|
||||
Reference in New Issue
Block a user