47
47
outputs :
48
48
artifact_matrix : ${{ steps.artifact-build-matrix.outputs.result }}
49
49
msystem : ${{steps.configure-environment.outputs.MSYSTEM}}
50
+ mingw-prefix : ${{steps.configure-environment.outputs.MINGW_PREFIX}}
50
51
mingw_package_prefix : ${{steps.configure-environment.outputs.MINGW_PACKAGE_PREFIX}}
51
52
sdk_repo_arch : ${{steps.configure-environment.outputs.SDK_REPO_ARCH}}
52
53
check-run-state : ${{steps.check-run-state.outputs.check-run-state}}
@@ -163,6 +164,7 @@ jobs:
163
164
echo "MSYSTEM=$MSYSTEM" >> $GITHUB_ENV
164
165
echo "MSYSTEM=$MSYSTEM" >> $GITHUB_OUTPUT
165
166
echo "MINGW_PREFIX=$MINGW_PREFIX" >> $GITHUB_ENV
167
+ echo "MINGW_PREFIX=$MINGW_PREFIX" >> $GITHUB_OUTPUT
166
168
echo "MINGW_PACKAGE_PREFIX=$MINGW_PACKAGE_PREFIX" >> $GITHUB_ENV
167
169
echo "MINGW_PACKAGE_PREFIX=$MINGW_PACKAGE_PREFIX" >> $GITHUB_OUTPUT
168
170
echo "SDK_REPO_ARCH=$SDK_REPO_ARCH" >> $GITHUB_OUTPUT
@@ -359,6 +361,7 @@ jobs:
359
361
needs : pkg
360
362
env :
361
363
MSYSTEM : ${{ needs.pkg.outputs.msystem }}
364
+ MINGW_PREFIX : ${{ needs.pkg.outputs.mingw-prefix }}
362
365
MINGW_PACKAGE_PREFIX : ${{ needs.pkg.outputs.mingw_package_prefix }}
363
366
SDK_REPO_ARCH : ${{ needs.pkg.outputs.sdk_repo_arch }}
364
367
strategy :
@@ -397,6 +400,7 @@ jobs:
397
400
git config --global user.name "$USER_NAME" &&
398
401
git config --global user.email "$USER_EMAIL"
399
402
- name : Clone and update build-extra
403
+ id : build-extra
400
404
run : |
401
405
d=/usr/src/build-extra &&
402
406
if test ! -d $d/.git
@@ -406,6 +410,7 @@ jobs:
406
410
git -C $d fetch https://github.com/git-for-windows/build-extra main &&
407
411
git -C $d switch -C main FETCH_HEAD
408
412
fi &&
413
+ echo "result=$(cygpath -am "$d")" >> $GITHUB_OUTPUT &&
409
414
if test -z "$BUILD_EXTRA_REV_FOR_EXISTING_GIT_TAG"
410
415
then
411
416
git -C $d -c pull.rebase=false pull "$PWD"/bundle-artifacts/build-extra.bundle main
@@ -480,6 +485,47 @@ jobs:
480
485
app-id : ${{ secrets.GH_APP_ID }}
481
486
private-key : ${{ secrets.GH_APP_PRIVATE_KEY }}
482
487
append-text : ' Built ${{ matrix.artifact.name }}'
488
+ - name : Run the installer
489
+ if : matrix.artifact.name == 'installer'
490
+ shell : pwsh
491
+ run : |
492
+ $exePath = Get-ChildItem -Path artifacts/*.exe | %{$_.FullName}
493
+ $installer = Start-Process -PassThru -Wait -FilePath "$exePath" -ArgumentList "/SILENT /VERYSILENT /NORESTART /SUPPRESSMSGBOXES /ALLOWDOWNGRADE=1 /LOG=installer.log"
494
+ $exitCode = $installer.ExitCode
495
+ if ($exitCode -ne 0) {
496
+ Write-Host "::error::Installer failed with exit code $exitCode!"
497
+ exit 1
498
+ }
499
+ "$env:ProgramFiles\Git\usr\bin" | Out-File -Encoding ascii -Append $env:GITHUB_PATH
500
+ "$env:ProgramFiles\Git\${{env.MINGW_PREFIX}}\bin" | Out-File -Encoding ascii -Append $env:GITHUB_PATH
501
+ - name : Publish installer log
502
+ if : matrix.artifact.name == 'installer' && (failure() || success())
503
+ uses : actions/upload-artifact@v4
504
+ with :
505
+ name : installer.log
506
+ path : installer.log
507
+ - name : Validate installer
508
+ if : matrix.artifact.name == 'installer'
509
+ shell : bash
510
+ run : |
511
+ set -x &&
512
+ grep 'Installation process succeeded' installer.log &&
513
+ ! grep -iw failed installer.log &&
514
+ cygpath -aw / &&
515
+ git.exe version --build-options >version &&
516
+ cat version &&
517
+ grep "$(sed -e 's|^v||' -e 's|-|.|g' <bundle-artifacts/next_version)" version &&
518
+ checklist=${{ toJSON(steps.build-extra.outputs.result) }}/installer/run-checklist.sh &&
519
+ # cannot test SSH keys in read-only mode, skip test for now
520
+ sed -i 's|[email protected] :v3/git-for-windows/git/git|https://github.com/git/git|' $checklist &&
521
+ sh -x $checklist
522
+ - name : update check-run
523
+ if : needs.pkg.outputs.check-run-state != '' && matrix.artifact.name == 'installer'
524
+ uses : ./.github/actions/check-run-action
525
+ with :
526
+ app-id : ${{ secrets.GH_APP_ID }}
527
+ private-key : ${{ secrets.GH_APP_PRIVATE_KEY }}
528
+ append-text : ' Validated the installer'
483
529
- name : update check-run if failed or canceled
484
530
if : needs.pkg.outputs.check-run-state != '' && (failure() || cancelled())
485
531
uses : ./.github/actions/check-run-action
0 commit comments