mirror of
https://github.com/actions/runner-images.git
synced 2025-12-17 23:28:57 +00:00
[Windows] Rename and refactor downloading function (#8906)
This commit is contained in:
committed by
GitHub
parent
bfe32a2b12
commit
7dba8776df
@@ -11,17 +11,17 @@ $kotlinDownloadUrl = Resolve-GithubReleaseAssetUrl `
|
||||
-Repo "JetBrains/kotlin" `
|
||||
-Version $kotlinVersion `
|
||||
-Asset "kotlin-compiler-*.zip"
|
||||
$kotlinInstallerPath = Start-DownloadWithRetry -Url $kotlinDownloadUrl -Name "kotlin-compiler.zip"
|
||||
$kotlinArchivePath = Invoke-DownloadWithRetry $kotlinDownloadUrl
|
||||
|
||||
#region Supply chain security
|
||||
$fileHash = (Get-FileHash -Path $kotlinInstallerPath -Algorithm SHA256).Hash
|
||||
$fileHash = (Get-FileHash -Path $kotlinArchivePath -Algorithm SHA256).Hash
|
||||
$externalHash = Get-HashFromGitHubReleaseBody -RepoOwner "JetBrains" -RepoName "kotlin" -FileName "$kotlinBinaryName-*.zip" -Version $kotlinVersion -WordNumber 2
|
||||
Use-ChecksumComparison $fileHash $externalHash
|
||||
#endregion
|
||||
|
||||
Write-Host "Expand Kotlin archive"
|
||||
$kotlinPath = "C:\tools"
|
||||
Expand-7ZipArchive -Path $kotlinInstallerPath -DestinationPath $kotlinPath
|
||||
Expand-7ZipArchive -Path $kotlinArchivePath -DestinationPath $kotlinPath
|
||||
|
||||
# Add to PATH
|
||||
Add-MachinePathItem "$kotlinPath\kotlinc\bin"
|
||||
|
||||
Reference in New Issue
Block a user