Files
runner-images-temp/images/windows/scripts/build/Install-ActionsCache.ps1
T

28 lines
1.1 KiB
PowerShell
Raw Normal View History

2023-10-12 04:43:41 -04:00
################################################################################
## File: Install-ActionsCache.ps1
## Desc: Downloads latest release from https://github.com/actions/action-versions
2023-10-12 04:43:41 -04:00
## Maintainer: #actions-runtime and @TingluoHuang
################################################################################
$actionArchiveCache = "C:\actionarchivecache\"
if (-not (Test-Path $actionArchiveCache)) {
2023-10-12 04:43:41 -04:00
Write-Host "Creating action archive cache folder"
New-Item -ItemType Directory -Path $actionArchiveCache | Out-Null
2023-10-12 04:43:41 -04:00
}
$downloadUrl = Resolve-GithubReleaseAssetUrl `
-Repo "actions/action-versions" `
-Version "latest" `
-Asset "action-versions.zip"
2023-10-12 04:43:41 -04:00
Write-Host "Download Latest action-versions archive from $downloadUrl"
$actionVersionsArchivePath = Invoke-DownloadWithRetry $downloadUrl
2023-10-12 04:43:41 -04:00
Write-Host "Expand action-versions archive"
Expand-7ZipArchive -Path $actionVersionsArchivePath -DestinationPath $actionArchiveCache
[Environment]::SetEnvironmentVariable("ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE", $actionArchiveCache, "Machine")
2023-10-12 04:43:41 -04:00
Invoke-PesterTests -TestFile "ActionArchiveCache"