mirror of
https://github.com/actions/runner-images.git
synced 2025-12-12 20:26:49 +00:00
* Use Resolve-GithubReleaseAssetUrl more widely * Add the Get-ChecksumFromUrl function * Sort exported functions and add docs * Remove alias and fix typo * Fix kind checksum url and syntax * Fix checksums url for gh cli and msys2 * [Windows] Cleanup various scripts * Add spaces after type specifications * Rename the Take-Part function
33 lines
1.1 KiB
PowerShell
33 lines
1.1 KiB
PowerShell
################################################################################
|
|
## File: Install-Kotlin.ps1
|
|
## Desc: Install Kotlin
|
|
## Supply chain security: Kotlin - checksum validation
|
|
################################################################################
|
|
|
|
# Install Kotlin
|
|
$kotlinVersion = (Get-ToolsetContent).kotlin.version
|
|
|
|
$kotlinDownloadUrl = Resolve-GithubReleaseAssetUrl `
|
|
-Repo "JetBrains/kotlin" `
|
|
-Version "$kotlinVersion" `
|
|
-Asset "kotlin-compiler-*.zip"
|
|
$kotlinArchivePath = Invoke-DownloadWithRetry $kotlinDownloadUrl
|
|
|
|
#region Supply chain security
|
|
$externalHash = Get-ChecksumFromGithubRelease `
|
|
-Repo "JetBrains/kotlin" `
|
|
-Version "$kotlinVersion" `
|
|
-FileName (Split-Path $kotlinDownloadUrl -Leaf) `
|
|
-HashType "SHA256"
|
|
Test-FileChecksum $kotlinArchivePath -ExpectedSHA256Sum $externalHash
|
|
#endregion
|
|
|
|
Write-Host "Expand Kotlin archive"
|
|
$kotlinPath = "C:\tools"
|
|
Expand-7ZipArchive -Path $kotlinArchivePath -DestinationPath $kotlinPath
|
|
|
|
# Add to PATH
|
|
Add-MachinePathItem "$kotlinPath\kotlinc\bin"
|
|
|
|
Invoke-PesterTests -TestFile "Tools" -TestName "Kotlin"
|