mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
chore(build): use official go distribution
This commit is contained in:
parent
a0375a09c7
commit
9568289cc8
|
@ -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'
|
||||
|
|
Loading…
Reference in a new issue