@@ -437,13 +437,81 @@ jobs:
437437 path : |
438438 signed
439439
440+ # ================================
441+ # Validate
442+ # ================================
443+ validate :
444+ name : Validate installers
445+ strategy :
446+ matrix :
447+ component :
448+ - os : ubuntu-latest
449+ artifact : linux-sign
450+ command : git-credential-manager-core
451+ - os : macos-latest
452+ artifact : osx-x64-sign
453+ command : git-credential-manager-core
454+ - os : windows-latest
455+ artifact : win-sign
456+ # Even when a standalone GCM version is installed, GitHub actions
457+ # runners still only recognize the version bundled with Git for
458+ # Windows due to its placement on the PATH. For this reason, we use
459+ # the full path to our installation to validate the Windows version.
460+ command : " $PROGRAMFILES (x86)/Git Credential Manager/git-credential-manager-core.exe"
461+ runs-on : ${{ matrix.component.os }}
462+ needs : [ osx-sign, win-sign, linux-sign ]
463+ steps :
464+ - uses : actions/checkout@v3
465+ with :
466+ fetch-depth : 0 # Indicate full history so Nerdbank.GitVersioning works.
467+
468+ - uses : dotnet/nbgv@master
469+ with :
470+ setCommonVars : true
471+
472+ - name : Download artifacts
473+ uses : actions/download-artifact@v3
474+ with :
475+ name : ${{ matrix.component.artifact }}
476+
477+ - name : Install Windows
478+ if : contains(matrix.component.os, 'windows')
479+ shell : pwsh
480+ run : |
481+ $exePaths = Get-ChildItem -Path ./signed/*.exe | %{$_.FullName}
482+ foreach ($exePath in $exePaths)
483+ {
484+ Start-Process -Wait -FilePath "$exePath" -ArgumentList "/SILENT /VERYSILENT /NORESTART"
485+ }
486+
487+ - name : Install Linux
488+ if : contains(matrix.component.os, 'ubuntu')
489+ run : |
490+ debpath=$(find ./*.deb)
491+ sudo apt install $debpath
492+ "${{ matrix.component.command }}" configure
493+
494+ - name : Install macOS
495+ if : contains(matrix.component.os, 'macos')
496+ run : |
497+ # Only validate x64, given arm64 agents are not available
498+ pkgpath=$(find ./*.pkg)
499+ sudo installer -pkg $pkgpath -target /
500+
501+ - name : Validate
502+ shell : bash
503+ run : |
504+ "${{ matrix.component.command }}" --version | sed 's/+.*//' >actual
505+ echo $GitBuildVersionSimple >expect
506+ cmp expect actual || exit 1
507+
440508# ================================
441509# Publish
442510# ================================
443511 create-github-release :
444512 name : Publish GitHub draft release
445513 runs-on : ubuntu-latest
446- needs : [ osx-sign, win-sign, linux-sign ]
514+ needs : [ validate ]
447515 steps :
448516 - name : Check out repository
449517 uses : actions/checkout@v3
0 commit comments