git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] ci(win+VS): download the vcpkg artifacts using a dedicated GitHub Action

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Aug 20, 2024, 14:31 UTC
Message-ID
<1e2ad9d536e075098edd913b326086a88c69ad4a.1724164270.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1775.git.1724164270.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>

The Git for Windows project provides a GitHub Action to download and cache Azure Pipelines artifacts (such as the `vcpkg` artifacts), hiding gnarly internals, and also providing some robustness against network glitches. Let's use it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 .github/workflows/main.yml | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 85e5767aae6..1ee0433acc1 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -181,14 +181,10 @@ jobs:
         repository: 'microsoft/vcpkg'
         path: 'compat/vcbuild/vcpkg'
     - name: download vcpkg artifacts
-      shell: powershell
-      run: |
-        $urlbase = "https://dev.azure.com/git/git/_apis/build/builds"
-        $id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=9&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
-        $downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[0].resource.downloadUrl
-        (New-Object Net.WebClient).DownloadFile($downloadUrl, "compat.zip")
-        Expand-Archive compat.zip -DestinationPath . -Force
-        Remove-Item compat.zip
+      uses: git-for-windows/get-azure-pipelines-artifact@v0
+      with:
+        repository: git/git
+        definitionId: 9
     - name: add msbuild to PATH
       uses: microsoft/setup-msbuild@v2
     - name: copy dlls to root
-- 
gitgitgadget
Previous: Johannes Schindelin via GitGitGadgetNext: Junio C Hamano
Message 3 of 6 in “Update the win+VS build definition”
  1. 0/2 Update the win+VS build definitionJohannes Schindelin via GitGitGadget, Aug 20, 2024
  2. 1/2 ci: bump microsoft/setup-msbuild from v1 to v2Johannes Schindelin via GitGitGadget, Aug 20, 2024
  3. 2/2 ci(win+VS): download the vcpkg artifacts using a dedicated GitHub ActionJohannes Schindelin via GitGitGadget, Aug 20, 2024
  4. Junio C HamanoAug 20, 2024
  5. Johannes SchindelinAug 20, 2024
  6. Junio C HamanoAug 20, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.