Build playable Aeternalis foundation and GitOps deployment pipeline
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$toolsDir = Join-Path $PSScriptRoot '..\.tools'
|
||||
New-Item -ItemType Directory -Force -Path $toolsDir | Out-Null
|
||||
$releases = Invoke-RestMethod 'https://go.dev/dl/?mode=json'
|
||||
$release = $releases | Where-Object stable | Select-Object -First 1
|
||||
$archive = $release.files | Where-Object { $_.os -eq 'windows' -and $_.arch -eq 'amd64' -and $_.kind -eq 'archive' } | Select-Object -First 1
|
||||
if (-not $archive) { throw 'No stable Windows Go archive found.' }
|
||||
$destination = Join-Path $toolsDir $archive.filename
|
||||
Invoke-WebRequest ('https://go.dev/dl/' + $archive.filename) -OutFile $destination
|
||||
if ((Get-FileHash $destination -Algorithm SHA256).Hash.ToLowerInvariant() -ne $archive.sha256) { throw 'Go checksum mismatch.' }
|
||||
Expand-Archive -LiteralPath $destination -DestinationPath $toolsDir -Force
|
||||
& (Join-Path $toolsDir 'go\bin\go.exe') version
|
||||
Reference in New Issue
Block a user