Skip to content

Commit d83a062

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 9ad1b64 commit d83a062

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
@@ -254,12 +254,44 @@ jobs:
254254
runs-on: ${{ matrix.os }}
255255

256256
steps:
257-
- name: Set up WinGet
258-
if: matrix.os == 'windows-11-arm'
259-
run: Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
260-
- name: Upgrade Git for Windows
257+
- name: Upgrade Git for Windows to latest stable release
261258
if: startsWith(matrix.os, 'windows')
262-
run: winget upgrade git --silent --accept-source-agreements --accept-package-agreements
259+
env:
260+
GH_TOKEN: ${{ github.token }}
261+
OS: ${{ matrix.os }}
262+
run: |
263+
$workingDir = '~/git-dl'
264+
$repo = 'git-for-windows/git'
265+
$pattern = ($Env:OS -eq 'windows-11-arm' ? 'Git-*-arm64.exe' : 'Git-*-64-bit.exe')
266+
$log = 'setup-log.txt'
267+
# Inno Setup args reference: https://jrsoftware.org/ishelp/index.php?topic=setupcmdline
268+
$arguments = @(
269+
'/VERYSILENT',
270+
'/SUPPRESSMSGBOXES',
271+
'/ALLUSERS',
272+
"/LOG=$log",
273+
'/NORESTART',
274+
'/CLOSEAPPLICATIONS',
275+
'/FORCECLOSEAPPLICATIONS'
276+
)
277+
278+
Write-Output 'Version and build information BEFORE upgrade:'
279+
Write-Output ''
280+
git version --build-options
281+
Write-Output ''
282+
283+
mkdir $workingDir | Out-Null
284+
cd $workingDir
285+
gh release download --repo $repo --pattern $pattern
286+
$installer = Get-Item $pattern
287+
Start-Process -FilePath $installer -ArgumentList $arguments -NoNewWindow -Wait
288+
289+
Get-Content -Path $log -Tail 50
290+
291+
Write-Output ''
292+
Write-Output 'Version and build information AFTER upgrade:'
293+
Write-Output ''
294+
git version --build-options
263295
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
264296
with:
265297
persist-credentials: false
@@ -329,11 +361,6 @@ jobs:
329361
runs-on: ${{ matrix.os }}
330362

331363
steps:
332-
- name: Set up WinGet
333-
if: matrix.os == 'windows-11-arm'
334-
run: Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
335-
- name: Upgrade Git for Windows
336-
run: winget upgrade git --silent --accept-source-agreements --accept-package-agreements
337364
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
338365
with:
339366
persist-credentials: false

0 commit comments

Comments
 (0)