Skip to content

Commit 03432b9

Browse files
committed
ci(vs-build): download the vcpkg artifacts using Bash, not PowerShell
It is much easier to read the invocation using `curl` and `jq` for non-PowerShell experts. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 1604dae commit 03432b9

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

.github/workflows/main.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,16 @@ jobs:
137137
- uses: actions/checkout@v2
138138
- uses: git-for-windows/setup-git-for-windows-sdk@main
139139
- name: download vcpkg artifacts
140-
shell: powershell
140+
shell: bash
141141
run: |
142-
$urlbase = "https://dev.azure.com/git/git/_apis/build/builds"
143-
$id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=9&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
144-
$downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[0].resource.downloadUrl
145-
(New-Object Net.WebClient).DownloadFile($downloadUrl, "compat.zip")
146-
Expand-Archive compat.zip -DestinationPath . -Force
147-
Remove-Item compat.zip
142+
urlbase=https://dev.azure.com/git/git/_apis/build/builds
143+
id=$(curl "$urlbase?definitions=9&statusFilter=completed&resultFilter=succeeded&\$top=1" |
144+
jq -r '.value[0].id')
145+
download_url=$(curl "$urlbase/$id/artifacts" |
146+
jq -r '.value[] | select(.name == "compat").resource.downloadUrl')
147+
curl -o compat.zip "$download_url"
148+
unzip compat.zip
149+
rm compat.zip
148150
- name: add msbuild to PATH
149151
uses: microsoft/setup-msbuild@v1
150152
- name: copy dlls to root

0 commit comments

Comments
 (0)