Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,28 @@ jobs:
steps:
- attach_workspace:
at: .
- run:
name: Install GitHub CLI
shell: powershell.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass
command: |
$ErrorActionPreference = 'Stop'
$gh = Get-Command gh -ErrorAction SilentlyContinue
if ($gh) { Write-Host "gh already installed at $($gh.Source)"; exit 0 }
$ghDir = Join-Path $env:LOCALAPPDATA 'gh'
New-Item -ItemType Directory -Force -Path $ghDir | Out-Null
$zipPath = Join-Path ([IO.Path]::GetTempPath()) 'gh.zip'
$apiUri = 'https://api.github.com/repos/cli/cli/releases/latest'
$release = Invoke-RestMethod -Uri $apiUri -Headers @{ 'User-Agent' = 'circleci' }
$asset = $release.assets | Where-Object { $_.name -match 'windows_amd64\.zip$' } | Select-Object -First 1
if (-not $asset) { throw 'Could not find GitHub CLI Windows amd64 zip in latest release' }
Write-Host "Downloading $($asset.name)"
Invoke-WebRequest -Uri $asset.browser_download_url -OutFile $zipPath
Expand-Archive -LiteralPath $zipPath -DestinationPath $ghDir -Force
$ghExe = Get-ChildItem -Path $ghDir -Recurse -Filter 'gh.exe' | Select-Object -First 1
if (-not $ghExe) { throw "gh.exe not found after extracting $zipPath" }
$env:Path = "$($ghExe.DirectoryName);$env:Path"
[Environment]::SetEnvironmentVariable('Path', $env:Path, 'User')
Write-Host "Installed gh at $($ghExe.FullName)"
- run:
name: Upload matching assets to a draft GitHub Release
shell: powershell.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass
Expand Down
Loading