[Windows] Update functions that get urls and hashes from Github (#8917)

* [Windows] Update function to get hash from github

* Remove redundant function and add documentation

* Fix aws-sam-cli url
This commit is contained in:
Vasilii Polikarpov
2023-11-30 17:12:17 +01:00
committed by GitHub
parent eb0e4ff100
commit d86c4900fa
5 changed files with 281 additions and 72 deletions

View File

@@ -9,12 +9,16 @@ $kotlinVersion = (Get-ToolsetContent).kotlin.version
$kotlinDownloadUrl = Resolve-GithubReleaseAssetUrl `
-Repo "JetBrains/kotlin" `
-Version $kotlinVersion `
-Version "$kotlinVersion" `
-Asset "kotlin-compiler-*.zip"
$kotlinArchivePath = Invoke-DownloadWithRetry $kotlinDownloadUrl
#region Supply chain security
$externalHash = Get-HashFromGitHubReleaseBody -RepoOwner "JetBrains" -RepoName "kotlin" -FileName "$kotlinBinaryName-*.zip" -Version $kotlinVersion -WordNumber 2
$externalHash = Get-GithubReleaseAssetHash `
-Repo "JetBrains/kotlin" `
-Version "$kotlinVersion" `
-FileName (Split-Path $kotlinDownloadUrl -Leaf) `
-HashType "SHA256"
Test-FileChecksum $kotlinArchivePath -ExpectedSHA256Sum $externalHash
#endregion