@@ -511,6 +511,9 @@ jobs:
511511
512512 make -C git -j$(sysctl -n hw.physicalcpu) GIT-VERSION-FILE dist dist-doc
513513
514+ export GIT_BUILT_FROM_COMMIT=$(gunzip -c git/git-$BUILD_VERSION.tar.gz | git get-tar-commit-id) ||
515+ die "Could not determine commit for build"
516+
514517 # Extract tarballs
515518 mkdir payload manpages
516519 tar -xvf git/git-$BUILD_VERSION.tar.gz -C payload
@@ -709,12 +712,83 @@ jobs:
709712 *.deb
710713 # End build and sign Debian package
711714
715+ # Validate installers
716+ validate-installers :
717+ name : Validate installers
718+ strategy :
719+ matrix :
720+ component :
721+ - os : ubuntu-latest
722+ artifact : linux-artifacts
723+ command : git
724+ - os : macos-latest
725+ artifact : macos-artifacts
726+ command : git
727+ - os : macos-latest
728+ artifact : macos-artifacts
729+ command : git
730+ - os : windows-latest
731+ artifact : win-installer-x86_64
732+ command : $PROGRAMFILES\Git\cmd\git.exe
733+ - os : windows-11-arm
734+ artifact : win-installer-aarch64
735+ command : $PROGRAMFILES\Git\cmd\git.exe
736+ runs-on : ${{ matrix.component.os }}
737+ needs : [prereqs, windows_artifacts, create-macos-artifacts, create-linux-artifacts]
738+ steps :
739+ - name : Download artifacts
740+ uses : actions/download-artifact@v4
741+ with :
742+ name : ${{ matrix.component.artifact }}
743+
744+ - name : Install Windows
745+ if : contains(matrix.component.artifact, 'win-installer')
746+ shell : pwsh
747+ run : |
748+ $exePath = Get-ChildItem -Path ./*.exe | %{$_.FullName}
749+ Start-Process -Wait -FilePath "$exePath" -ArgumentList "/SILENT /VERYSILENT /NORESTART /SUPPRESSMSGBOXES /ALLOWDOWNGRADE=1"
750+
751+ - name : Install Linux
752+ if : contains(matrix.component.artifact, 'linux')
753+ run : |
754+ debpath=$(find ./*.deb)
755+ sudo apt install $debpath
756+
757+ - name : Install macOS
758+ if : contains(matrix.component.artifact, 'macos')
759+ run : |
760+ # avoid letting Homebrew's `git` in `/opt/homebrew/bin` override `/usr/local/bin/git`
761+ arch="$(uname -m)"
762+ test arm64 != "$arch" ||
763+ brew uninstall git
764+
765+ pkgpath=$(find ./*universal*.pkg)
766+ sudo installer -pkg $pkgpath -target /
767+
768+ - name : Validate
769+ shell : bash
770+ run : |
771+ "${{ matrix.component.command }}" --version | sed 's/git version //' >actual
772+ echo "${{ needs.prereqs.outputs.tag_version }}" | sed 's/-rc/.rc/g' >expect
773+ cmp expect actual || exit 1
774+
775+ - name : Validate universal binary CPU architecture
776+ if : contains(matrix.component.os, 'macos')
777+ shell : bash
778+ run : |
779+ set -ex
780+ git version --build-options >actual
781+ cat actual
782+ grep "cpu: $(uname -m)" actual
783+ # End validate installers
784+
712785 create-github-release :
713786 runs-on : ubuntu-latest
714787 permissions :
715788 contents : write
716789 id-token : write # required for Azure login via OIDC
717790 needs :
791+ - validate-installers
718792 - create-linux-artifacts
719793 - create-macos-artifacts
720794 - windows_artifacts
0 commit comments