File tree Expand file tree Collapse file tree 1 file changed +5
-21
lines changed
.azure-pipelines/generation-templates Expand file tree Collapse file tree 1 file changed +5
-21
lines changed Original file line number Diff line number Diff line change 11steps :
22- pwsh : |
3- $releaseJson = Invoke-RestMethod "https://api.github.com/repos/microsoft/kiota/releases/latest"
4- $latestTag = $releaseJson.tag_name
5- $asset = $releaseJson.assets | Where-Object { $_.name -match "linux-x64" } | Select-Object -First 1
6- Write-Host "Downloading Kiota $latestTag"
7- Write-Host "Asset URL: $($asset.browser_download_url)"
8-
9- $extractDir = Join-Path ([System.IO.Path]::GetTempPath()) "kiota_extract_$([System.IO.Path]::GetRandomFileName())"
10- New-Item -ItemType Directory -Force -Path $extractDir | Out-Null
11- $downloadPath = Join-Path $extractDir "kiota_download.zip"
12-
13- Invoke-WebRequest -Uri $asset.browser_download_url -OutFile $downloadPath
14- Expand-Archive -Path $downloadPath -DestinationPath $extractDir -Force
15-
16- Write-Host "=== Extracted contents ==="
17- Get-ChildItem $extractDir -Recurse | Select-Object FullName
18-
19- $kiotaBin = Get-ChildItem -Path $extractDir -Recurse -File | Where-Object { $_.BaseName -eq "kiota" } | Select-Object -First 1
20- Write-Host "Found Kiota binary at: $($kiotaBin.FullName)"
21-
3+ dotnet tool install --global Microsoft.OpenApi.Kiota
4+ $kiotaPath = Join-Path $HOME ".dotnet" "tools" "kiota"
5+ Write-Host "Kiota installed at: $kiotaPath"
226 New-Item -ItemType Directory -Force -Path "$(Build.ArtifactStagingDirectory)" | Out-Null
23- Copy-Item -Path $kiotaBin.FullName -Destination (Join-Path "$(Build.ArtifactStagingDirectory)" "kiota")
24- displayName : ' Download latest Kiota from GitHub '
7+ Copy-Item -Path $kiotaPath -Destination (Join-Path "$(Build.ArtifactStagingDirectory)" "kiota")
8+ displayName : ' Install Kiota via dotnet tool '
You can’t perform that action at this time.
0 commit comments