chore(build): use official go distribution

This commit is contained in:
Jan De Dobbeleer 2024-02-13 08:45:40 +01:00 committed by Jan De Dobbeleer
parent a0375a09c7
commit 9568289cc8

View file

@ -7,31 +7,6 @@ branding:
runs:
using: "composite"
steps:
- name: Install Go 🚀
env:
VERSION: "1.22.0"
shell: pwsh
run: |
# Delete conflicting go versions first
Remove-Item -Path "$env:RUNNER_TOOL_CACHE/go" -Recurse -Force -ErrorAction Ignore
# Download source
$tempZip = "$env:RUNNER_TEMP/source.zip"
Invoke-WebRequest "https://github.com/jandedobbeleer/go/releases/download/$env:VERSION/go.zip" -OutFile $tempZip
# Extract to correct location
Expand-Archive $tempZip -DestinationPath $env:RUNNER_TEMP -Force
$sourceFolder = Join-Path $env:RUNNER_TOOL_CACHE "go"
New-Item -ItemType Directory -Path $sourceFolder
Move-Item "$env:RUNNER_TEMP/go/*" $sourceFolder -Force
# Set correct permissions on go executables
chmod a+x "$sourceFolder/bin/go" 2>&1
Get-ChildItem "$sourceFolder/pkg/tool/linux_amd64" | ForEach-Object {
chmod a+x $_ 2>&1
}
# Add to path
"$sourceFolder/bin" >> $env:GITHUB_PATH
"GOROOT=$sourceFolder" >> $env:GITHUB_ENV
"GOPATH=$sourceFolder" >> $env:GITHUB_ENV
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
with:
go-version: '1.22.0'