From f3d72108064a522f199880fe5ef6e19996de8c73 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Fri, 17 Oct 2025 11:41:47 -0400 Subject: [PATCH 1/5] Test `winget` as another way to upgrade GfW on CI Upgrading Git for Windows is not usually needed at all. The idea here is to test `winget` to see if it can do it more simply than the code that has been added and removed multiple times before that downloads the installer from the GitHub release and runs it, passing a number of non-obvious InnoSetup arguments. If this works, then it could be a one-liner, but we would still not want to do it by default, and also it may be that not all runners will have `winget` installed or that not all runners will have `winget` set up in a usable way. This applies only to Windows, of course. --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 57fe83ef471..f04d203a907 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -234,6 +234,9 @@ jobs: runs-on: ${{ matrix.os }} steps: + - name: Upgrade Git for Windows + if: startsWith(matrix.os, 'windows') + run: winget upgrade git --accept-source-agreements - uses: actions/checkout@v6 with: persist-credentials: false @@ -285,6 +288,8 @@ jobs: runs-on: ${{ matrix.os }} steps: + - name: Upgrade Git for Windows + run: winget upgrade git --accept-source-agreements - uses: actions/checkout@v6 with: persist-credentials: false From 9024296abd5453544f269465e46992834f1c7714 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Fri, 17 Oct 2025 11:56:25 -0400 Subject: [PATCH 2/5] Install missing `winget` on the `windows-11-arm` runner --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f04d203a907..3dca908d9de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -234,6 +234,9 @@ jobs: runs-on: ${{ matrix.os }} steps: + - name: Set up WinGet + if: matrix.os == 'windows-11-arm' + run: Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe - name: Upgrade Git for Windows if: startsWith(matrix.os, 'windows') run: winget upgrade git --accept-source-agreements @@ -288,6 +291,9 @@ jobs: runs-on: ${{ matrix.os }} steps: + - name: Set up WinGet + if: matrix.os == 'windows-11-arm' + run: Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe - name: Upgrade Git for Windows run: winget upgrade git --accept-source-agreements - uses: actions/checkout@v6 From 42fadf0cbfacc3ee23d47aa1838639eef392d713 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Fri, 17 Oct 2025 12:01:52 -0400 Subject: [PATCH 3/5] Try more flags to let it send the country code to the server --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3dca908d9de..0e76db3f858 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -239,7 +239,7 @@ jobs: run: Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe - name: Upgrade Git for Windows if: startsWith(matrix.os, 'windows') - run: winget upgrade git --accept-source-agreements + run: winget upgrade git --silent --accept-source-agreements --accept-package-agreements - uses: actions/checkout@v6 with: persist-credentials: false @@ -295,7 +295,7 @@ jobs: if: matrix.os == 'windows-11-arm' run: Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe - name: Upgrade Git for Windows - run: winget upgrade git --accept-source-agreements + run: winget upgrade git --silent --accept-source-agreements --accept-package-agreements - uses: actions/checkout@v6 with: persist-credentials: false From 9c9d2d2c8eee9afb0baac7b5ccecb9db11b67b5e Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Fri, 17 Oct 2025 12:28:17 -0400 Subject: [PATCH 4/5] Abandon `winget` idea; start on upgrading GfW the old way So far this only attempts to upgrade it for `test-fast` because whatever is going to go wrong may as well be fixed for that before extending it to `test-fixtures-windows`. The approach followed here is similar to what was done in the past, but some specific details differ, including trying to make it work for both ARM64 and x64 systems and putting everything in a single step rather than three steps. --- .github/workflows/ci.yml | 47 +++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e76db3f858..43691f1a3fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -234,12 +234,44 @@ jobs: runs-on: ${{ matrix.os }} steps: - - name: Set up WinGet - if: matrix.os == 'windows-11-arm' - run: Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe - - name: Upgrade Git for Windows + - name: Upgrade Git for Windows to latest stable release if: startsWith(matrix.os, 'windows') - run: winget upgrade git --silent --accept-source-agreements --accept-package-agreements + env: + GH_TOKEN: ${{ github.token }} + OS: ${{ matrix.os }} + run: | + $workingDir = '~/git-dl' + $repo = 'git-for-windows/git' + $pattern = ($Env:OS -eq 'windows-11-arm' ? 'Git-*-arm64.exe' : 'Git-*-64-bit.exe') + $log = 'setup-log.txt' + # Inno Setup args reference: https://jrsoftware.org/ishelp/index.php?topic=setupcmdline + $arguments = @( + '/VERYSILENT', + '/SUPPRESSMSGBOXES', + '/ALLUSERS', + "/LOG=$log", + '/NORESTART', + '/CLOSEAPPLICATIONS', + '/FORCECLOSEAPPLICATIONS' + ) + + Write-Output 'Version and build information BEFORE upgrade:' + Write-Output '' + git version --build-options + Write-Output '' + + mkdir $workingDir | Out-Null + cd $workingDir + gh release download --repo $repo --pattern $pattern + $installer = Get-Item $pattern + Start-Process -FilePath $installer -ArgumentList $arguments -NoNewWindow -Wait + + Get-Content -Path $log -Tail 50 + + Write-Output '' + Write-Output 'Version and build information AFTER upgrade:' + Write-Output '' + git version --build-options - uses: actions/checkout@v6 with: persist-credentials: false @@ -291,11 +323,6 @@ jobs: runs-on: ${{ matrix.os }} steps: - - name: Set up WinGet - if: matrix.os == 'windows-11-arm' - run: Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe - - name: Upgrade Git for Windows - run: winget upgrade git --silent --accept-source-agreements --accept-package-agreements - uses: actions/checkout@v6 with: persist-credentials: false From 60eadfe35b59597afcca8d83ea2b0d2a0a8747f6 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Fri, 17 Oct 2025 12:57:35 -0400 Subject: [PATCH 5/5] Upgrade GfW in `test-fixtures-windows` too, without duplication GitHub Actions has recently started supporting YAML anchors: - https://github.blog/changelog/2025-09-18-actions-yaml-anchors-and-non-public-workflow-templates/ - https://docs.github.com/en/actions/reference/workflows-and-actions/reusing-workflow-configurations#yaml-anchors-and-aliases This uses that to have the same step in two separate job definitions without duplicating the code itself. It would often be preferable do put the job in a composite action, but as noted in previous commit messages (especially in the parenthesized paragraph at the end of 9e4e3ec), this job is best run before `actions/checkout`, yet retrieving the action definition from the current repository at the same ref (in a way that is not excessively complicated or slow) requires that `actions/checkout` have been used first. So this uses a YAML anchor instead. --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43691f1a3fd..7ffb5cdac0a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -234,7 +234,8 @@ jobs: runs-on: ${{ matrix.os }} steps: - - name: Upgrade Git for Windows to latest stable release + - &upgrade_git_for_windows + name: Upgrade Git for Windows to latest stable release if: startsWith(matrix.os, 'windows') env: GH_TOKEN: ${{ github.token }} @@ -323,6 +324,7 @@ jobs: runs-on: ${{ matrix.os }} steps: + - *upgrade_git_for_windows - uses: actions/checkout@v6 with: persist-credentials: false