From 7656cd47d3c30216d25289328532fb12074abaa3 Mon Sep 17 00:00:00 2001 From: EduardGomezEscandell Date: Thu, 21 Sep 2023 12:10:20 +0200 Subject: [PATCH] setup-go is broken --- .github/workflows/qa-azure.yaml | 38 ++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/.github/workflows/qa-azure.yaml b/.github/workflows/qa-azure.yaml index eda559063..4a9f68de5 100644 --- a/.github/workflows/qa-azure.yaml +++ b/.github/workflows/qa-azure.yaml @@ -47,9 +47,37 @@ jobs: with: distro: "Ubuntu-Preview" - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version-file: "go.work" + shell: powershell + run: | + $path = ( + (Invoke-WebRequest -Uri "https://go.dev/dl/").Links.Href ` + | Select-String '/dl/go.*windows-amd64.msi' ` + | Select-Object -First 1 ` + ) + + if ( "${path}" -eq "" ) { + Write-Error "Could not find Go download" + exit(1) + } + + $URL = "https://go.dev${path}" + $file = "${HOME}/Downloads/" + ($path -replace '/dl/', '') + + if ( Test-Path "${file}" ) { + Write-Output "Cache hit: using ${file}" + } else { + Write-Output "Cache miss: downloading ${URL}" + Invoke-WebRequest -Uri "${URL}" -Outfile "${file}" + } + + try { + msiexec.exe /i "${file}" /quiet + } catch { + Write-Error "${Error}" + Exit(1) + } + + Exit(0) - name: Set up Flutter uses: subosito/flutter-action@v2 with: @@ -80,8 +108,8 @@ jobs: | select(.Version | endswith("${want_version}") | not ) | (.Path) + "@${want_version}" "@) - go get $dependencies - go mod tidy + go.exe get $dependencies + go.exe mod tidy Write-Output "::endgroup::" New-Item -ItemType Directory "ci-build/wsl-pro-service"