Skip to content

Commit 50a1e5a

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 43eeb78 commit 50a1e5a

1 file changed

Lines changed: 37 additions & 10 deletions

File tree

.github/workflows/ci.yml

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

274274
steps:
275-
- name: Set up WinGet
276-
if: matrix.os == 'windows-11-arm'
277-
run: Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
278-
- name: Upgrade Git for Windows
275+
- name: Upgrade Git for Windows to latest stable release
279276
if: startsWith(matrix.os, 'windows')
280-
run: winget upgrade git --silent --accept-source-agreements --accept-package-agreements
277+
env:
278+
GH_TOKEN: ${{ github.token }}
279+
OS: ${{ matrix.os }}
280+
run: |
281+
$workingDir = '~/git-dl'
282+
$repo = 'git-for-windows/git'
283+
$pattern = ($Env:OS -eq 'windows-11-arm' ? 'Git-*-arm64.exe' : 'Git-*-64-bit.exe')
284+
$log = 'setup-log.txt'
285+
# Inno Setup args reference: https://jrsoftware.org/ishelp/index.php?topic=setupcmdline
286+
$arguments = @(
287+
'/VERYSILENT',
288+
'/SUPPRESSMSGBOXES',
289+
'/ALLUSERS',
290+
"/LOG=$log",
291+
'/NORESTART',
292+
'/CLOSEAPPLICATIONS',
293+
'/FORCECLOSEAPPLICATIONS'
294+
)
295+
296+
Write-Output 'Version and build information BEFORE upgrade:'
297+
Write-Output ''
298+
git version --build-options
299+
Write-Output ''
300+
301+
mkdir $workingDir | Out-Null
302+
cd $workingDir
303+
gh release download --repo $repo --pattern $pattern
304+
$installer = Get-Item $pattern
305+
Start-Process -FilePath $installer -ArgumentList $arguments -NoNewWindow -Wait
306+
307+
Get-Content -Path $log -Tail 50
308+
309+
Write-Output ''
310+
Write-Output 'Version and build information AFTER upgrade:'
311+
Write-Output ''
312+
git version --build-options
281313
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
282314
with:
283315
persist-credentials: false
@@ -347,11 +379,6 @@ jobs:
347379
runs-on: ${{ matrix.os }}
348380

349381
steps:
350-
- name: Set up WinGet
351-
if: matrix.os == 'windows-11-arm'
352-
run: Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
353-
- name: Upgrade Git for Windows
354-
run: winget upgrade git --silent --accept-source-agreements --accept-package-agreements
355382
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
356383
with:
357384
persist-credentials: false

0 commit comments

Comments
 (0)