Skip to content

Commit 04d6e84

Browse files
ldenningtonmjcheetham
authored andcommitted
release: add installer validation
Add basic installer validation to release pipeline for Windows, macOS, and Linux (Debian package only). Validation runs the installers/any necessary setup and checks that the installed version matches the expected version.
1 parent c850106 commit 04d6e84

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

.github/workflows/build-git-installers.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,12 +643,83 @@ jobs:
643643
*.deb
644644
# End build and sign Debian package
645645

646+
# Validate installers
647+
validate-installers:
648+
name: Validate installers
649+
strategy:
650+
matrix:
651+
component:
652+
- os: ubuntu-latest
653+
artifact: linux-artifacts
654+
command: git
655+
- os: macos-latest-xl-arm64
656+
artifact: macos-artifacts
657+
command: git
658+
- os: macos-latest
659+
artifact: macos-artifacts
660+
command: git
661+
- os: windows-latest
662+
artifact: win-installer-x86_64
663+
command: $PROGRAMFILES\Git\cmd\git.exe
664+
- os: ['self-hosted', '1ES.Pool=github-arm64-pool']
665+
artifact: win-installer-aarch64
666+
command: $PROGRAMFILES\Git\cmd\git.exe
667+
runs-on: ${{ matrix.component.os }}
668+
needs: [prereqs, windows_artifacts, create-macos-artifacts, create-linux-artifacts]
669+
steps:
670+
- name: Download artifacts
671+
uses: actions/download-artifact@v4
672+
with:
673+
name: ${{ matrix.component.artifact }}
674+
675+
- name: Install Windows
676+
if: contains(matrix.component.artifact, 'win-installer')
677+
shell: pwsh
678+
run: |
679+
$exePath = Get-ChildItem -Path ./*.exe | %{$_.FullName}
680+
Start-Process -Wait -FilePath "$exePath" -ArgumentList "/SILENT /VERYSILENT /NORESTART /SUPPRESSMSGBOXES /ALLOWDOWNGRADE=1"
681+
682+
- name: Install Linux
683+
if: contains(matrix.component.artifact, 'linux')
684+
run: |
685+
debpath=$(find ./*.deb)
686+
sudo apt install $debpath
687+
688+
- name: Install macOS
689+
if: contains(matrix.component.artifact, 'macos')
690+
run: |
691+
# avoid letting Homebrew's `git` in `/opt/homebrew/bin` override `/usr/local/bin/git`
692+
arch="$(uname -m)"
693+
test arm64 != "$arch" ||
694+
brew uninstall git
695+
696+
pkgpath=$(find ./*universal*.pkg)
697+
sudo installer -pkg $pkgpath -target /
698+
699+
- name: Validate
700+
shell: bash
701+
run: |
702+
"${{ matrix.component.command }}" --version | sed 's/git version //' >actual
703+
echo ${{ needs.prereqs.outputs.tag_version }} >expect
704+
cmp expect actual || exit 1
705+
706+
- name: Validate universal binary CPU architecture
707+
if: contains(matrix.component.os, 'macos')
708+
shell: bash
709+
run: |
710+
set -ex
711+
git version --build-options >actual
712+
cat actual
713+
grep "cpu: $(uname -m)" actual
714+
# End validate installers
715+
646716
create-github-release:
647717
runs-on: ubuntu-latest
648718
permissions:
649719
contents: write
650720
id-token: write # required for Azure login via OIDC
651721
needs:
722+
- validate-installers
652723
- create-linux-artifacts
653724
- create-macos-artifacts
654725
- windows_artifacts

0 commit comments

Comments
 (0)