mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2026-01-04 00:08:54 +08:00
[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:
committed by
GitHub
parent
eb0e4ff100
commit
d86c4900fa
@@ -9,17 +9,24 @@ Install-ChocoPackage awscli
|
||||
|
||||
# Install Session Manager Plugin for the AWS CLI
|
||||
Install-Binary `
|
||||
-Url "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/windows/SessionManagerPluginSetup.exe" `
|
||||
-InstallArgs ("/silent", "/install") `
|
||||
-ExpectedSignature "FF457E5732E98A9F156E657F8CC7C4432507C3BB"
|
||||
-Url "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/windows/SessionManagerPluginSetup.exe" `
|
||||
-InstallArgs ("/silent", "/install") `
|
||||
-ExpectedSignature "FF457E5732E98A9F156E657F8CC7C4432507C3BB"
|
||||
$env:Path = $env:Path + ";$env:ProgramFiles\Amazon\SessionManagerPlugin\bin"
|
||||
|
||||
# Install AWS SAM CLI
|
||||
$packageName = "AWS_SAM_CLI_64_PY3.msi"
|
||||
$packageUrl = "https://github.com/awslabs/aws-sam-cli/releases/latest/download/$packageName"
|
||||
$externalHash = Get-HashFromGitHubReleaseBody -RepoOwner "awslabs" -RepoName "aws-sam-cli" -FileName $packageName
|
||||
$downloadUrl = Resolve-GithubReleaseAssetUrl `
|
||||
-Repo "awslabs/aws-sam-cli" `
|
||||
-Version "latest" `
|
||||
-UrlMatchPattern "AWS_SAM_CLI_64_PY3.msi"
|
||||
$externalHash = Get-GithubReleaseAssetHash `
|
||||
-Repo "awslabs/aws-sam-cli" `
|
||||
-Version "latest" `
|
||||
-FileName (Split-Path $downloadUrl -Leaf) `
|
||||
-HashType "SHA256"
|
||||
|
||||
Install-Binary `
|
||||
-Url $packageUrl `
|
||||
-ExpectedSHA256Sum $externalHash
|
||||
-Url $downloadUrl `
|
||||
-ExpectedSHA256Sum $externalHash
|
||||
|
||||
Invoke-PesterTests -TestFile "CLI.Tools" -TestName "AWS"
|
||||
|
||||
@@ -5,12 +5,17 @@
|
||||
################################################################################
|
||||
|
||||
# Install the latest version of Git for Windows
|
||||
$repoURL = "https://api.github.com/repos/git-for-windows/git/releases/latest"
|
||||
$gitReleases = Invoke-RestMethod $repoURL
|
||||
$downloadUrl = $gitReleases.assets.browser_download_url -match "Git-.+-64-bit.exe" | Select-Object -First 1
|
||||
|
||||
$installerFile = Split-Path $downloadUrl -Leaf
|
||||
$externalHash = Get-HashFromGitHubReleaseBody -Url $RepoURL -FileName $installerFile
|
||||
$downloadUrl = Resolve-GithubReleaseAssetUrl `
|
||||
-Repo "git-for-windows/git" `
|
||||
-Version "latest" `
|
||||
-UrlMatchPattern "Git-*-64-bit.exe"
|
||||
|
||||
$externalHash = Get-GithubReleaseAssetHash `
|
||||
-Repo "git-for-windows/git" `
|
||||
-Version "latest" `
|
||||
-FileName (Split-Path $downloadUrl -Leaf) `
|
||||
-HashType "SHA256"
|
||||
|
||||
Install-Binary `
|
||||
-Url $downloadUrl `
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user