mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-09 20:44:03 -08:00
fix: setup go correctly in bootstrap
This commit is contained in:
parent
ee13e9c50e
commit
175e5ece04
7
.github/workflows/build_code.yml
vendored
7
.github/workflows/build_code.yml
vendored
|
@ -27,3 +27,10 @@ jobs:
|
||||||
version: latest
|
version: latest
|
||||||
args: build --rm-dist --snapshot --skip-post-hooks --skip-before
|
args: build --rm-dist --snapshot --skip-post-hooks --skip-before
|
||||||
workdir: src
|
workdir: src
|
||||||
|
- name: Archive production artifacts
|
||||||
|
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb
|
||||||
|
with:
|
||||||
|
name: builds
|
||||||
|
retention-days: 1
|
||||||
|
path: |
|
||||||
|
src/dist
|
||||||
|
|
|
@ -7,14 +7,30 @@ branding:
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- name: Install Go
|
- name: Install Go 🚀
|
||||||
uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f
|
env:
|
||||||
with:
|
VERSION: "1.19.4"
|
||||||
go-version: 1.19.4
|
|
||||||
- name: Override Go ♻️
|
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
$goBin = $(Get-Command go).Source
|
# Delete conflicting go versions first
|
||||||
Invoke-WebRequest 'https://github.com/jandedobbeleer/go/releases/download/1.19.4/go' -OutFile "$goBin"
|
Remove-Item -Path "$env:RUNNER_TOOL_CACHE/go" -Recurse -Force -ErrorAction Ignore
|
||||||
chmod a+x $goBin 2>&1
|
|
||||||
go version
|
# 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
|
||||||
|
|
Loading…
Reference in a new issue