Merge pull request #14229 from spowelljr/updateWindowGo

CI: Automate updating Window Go version
pull/12995/head
Steven Powell 2022-05-25 15:02:48 -07:00 committed by GitHub
commit 89dd1b3c4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View File

@ -30,6 +30,7 @@ function Write-GithubStatus {
$env:SHORT_COMMIT=$env:COMMIT.substring(0, 7)
$gcs_bucket="minikube-builds/logs/$env:MINIKUBE_LOCATION/$env:ROOT_JOB_ID"
$env:MINIKUBE_SUPPRESS_DOCKER_PERFORMANCE="true"
$GoVersion = "1.18.2"
# Docker's kubectl breaks things, and comes earlier in the path than the regular kubectl. So download the expected kubectl and replace Docker's version.
$KubeVersion = (Invoke-WebRequest -Uri 'https://storage.googleapis.com/kubernetes-release/release/stable.txt' -UseBasicParsing).Content
@ -53,6 +54,18 @@ If ($lastexitcode -gt 0) {
Exit $lastexitcode
}
# Download Go
$CurrentGo = go version
if ($CurrentGo -NotLike "*$GoVersion*") {
(New-Object Net.WebClient).DownloadFile("https://go.dev/dl/go$GoVersion.windows-amd64.zip", "$env:TEMP\golang.zip")
Remove-Item "c:\Program Files\Go\*" -Recurse
Add-Type -Assembly "System.IO.Compression.Filesystem"
[System.IO.Compression.ZipFile]::ExtractToDirectory("$env:TEMP\golang.zip", "$env:TEMP\golang")
Copy-Item -Path "$env:TEMP\golang\go\*" -Destination "c:\Program Files\Go\" -Recurse
Remove-Item "$env:TEMP\golang" -Recurse
Remove-Item "$env:TEMP\golang.zip"
}
# Download gopogh and gotestsum
(New-Object Net.WebClient).DownloadFile("https://github.com/medyagh/gopogh/releases/download/v0.13.0/gopogh.exe", "C:\Go\bin\gopogh.exe")
(New-Object Net.WebClient).DownloadFile("https://github.com/gotestyourself/gotestsum/releases/download/v1.8.1/gotestsum_1.8.1_windows_amd64.tar.gz", "$env:TEMP\gotestsum.tar.gz")

View File

@ -137,6 +137,11 @@ var (
`VERSION_TO_INSTALL=.*`: `VERSION_TO_INSTALL={{.StableVersion}}`,
},
},
"hack/jenkins/common.ps1": {
Replace: map[string]string{
`GoVersion = ".*"`: `GoVersion = "{{.StableVersion}}"`,
},
},
}
// PR data