Skip to content

Commit 8bd4cbf

Browse files
committed
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.
1 parent 46d5a4c commit 8bd4cbf

File tree

1 file changed

+37
-10
lines changed

1 file changed

+37
-10
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,44 @@ jobs:
234234
runs-on: ${{ matrix.os }}
235235

236236
steps:
237-
- name: Set up WinGet
238-
if: matrix.os == 'windows-11-arm'
239-
run: Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
240-
- name: Upgrade Git for Windows
237+
- name: Upgrade Git for Windows to latest stable release
241238
if: startsWith(matrix.os, 'windows')
242-
run: winget upgrade git --silent --accept-source-agreements --accept-package-agreements
239+
env:
240+
GH_TOKEN: ${{ github.token }}
241+
OS: ${{ matrix.os }}
242+
run: |
243+
$workingDir = '~/git-dl'
244+
$repo = 'git-for-windows/git'
245+
$pattern = ($Env:OS -eq 'windows-11-arm' ? 'Git-*-arm64.exe' : 'Git-*-64-bit.exe')
246+
$log = 'setup-log.txt'
247+
# Inno Setup args reference: https://jrsoftware.org/ishelp/index.php?topic=setupcmdline
248+
$arguments = @(
249+
'/VERYSILENT',
250+
'/SUPPRESSMSGBOXES',
251+
'/ALLUSERS',
252+
"/LOG=$log",
253+
'/NORESTART',
254+
'/CLOSEAPPLICATIONS',
255+
'/FORCECLOSEAPPLICATIONS'
256+
)
257+
258+
Write-Output 'Version and build information BEFORE upgrade:'
259+
Write-Output ''
260+
git version --build-options
261+
Write-Output ''
262+
263+
mkdir $workingDir | Out-Null
264+
cd $workingDir
265+
gh release download --repo $repo --pattern $pattern
266+
$installer = Get-Item $pattern
267+
Start-Process -FilePath $installer -ArgumentList $arguments -NoNewWindow -Wait
268+
269+
Get-Content -Path $log -Tail 50
270+
271+
Write-Output ''
272+
Write-Output 'Version and build information AFTER upgrade:'
273+
Write-Output ''
274+
git version --build-options
243275
- uses: actions/checkout@v5
244276
with:
245277
persist-credentials: false
@@ -291,11 +323,6 @@ jobs:
291323
runs-on: ${{ matrix.os }}
292324

293325
steps:
294-
- name: Set up WinGet
295-
if: matrix.os == 'windows-11-arm'
296-
run: Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
297-
- name: Upgrade Git for Windows
298-
run: winget upgrade git --silent --accept-source-agreements --accept-package-agreements
299326
- uses: actions/checkout@v5
300327
with:
301328
persist-credentials: false

0 commit comments

Comments
 (0)