Skip to content

Commit 0556c49

Browse files
ldenningtondscho
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 c41d1bd commit 0556c49

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
@@ -612,12 +612,83 @@ jobs:
612612
*.deb
613613
# End build and sign Debian package
614614

615+
# Validate installers
616+
validate-installers:
617+
name: Validate installers
618+
strategy:
619+
matrix:
620+
component:
621+
- os: ubuntu-latest
622+
artifact: linux-artifacts
623+
command: git
624+
- os: macos-latest-xl-arm64
625+
artifact: macos-artifacts
626+
command: git
627+
- os: macos-latest
628+
artifact: macos-artifacts
629+
command: git
630+
- os: windows-latest
631+
artifact: win-installer-x86_64
632+
command: $PROGRAMFILES\Git\cmd\git.exe
633+
- os: ['self-hosted', '1ES.Pool=github-arm64-pool']
634+
artifact: win-installer-aarch64
635+
command: $PROGRAMFILES\Git\cmd\git.exe
636+
runs-on: ${{ matrix.component.os }}
637+
needs: [prereqs, windows_artifacts, create-macos-artifacts, create-linux-artifacts]
638+
steps:
639+
- name: Download artifacts
640+
uses: actions/download-artifact@v4
641+
with:
642+
name: ${{ matrix.component.artifact }}
643+
644+
- name: Install Windows
645+
if: contains(matrix.component.artifact, 'win-installer')
646+
shell: pwsh
647+
run: |
648+
$exePath = Get-ChildItem -Path ./*.exe | %{$_.FullName}
649+
Start-Process -Wait -FilePath "$exePath" -ArgumentList "/SILENT /VERYSILENT /NORESTART /SUPPRESSMSGBOXES /ALLOWDOWNGRADE=1"
650+
651+
- name: Install Linux
652+
if: contains(matrix.component.artifact, 'linux')
653+
run: |
654+
debpath=$(find ./*.deb)
655+
sudo apt install $debpath
656+
657+
- name: Install macOS
658+
if: contains(matrix.component.artifact, 'macos')
659+
run: |
660+
# avoid letting Homebrew's `git` in `/opt/homebrew/bin` override `/usr/local/bin/git`
661+
arch="$(uname -m)"
662+
test arm64 != "$arch" ||
663+
brew uninstall git
664+
665+
pkgpath=$(find ./*universal*.pkg)
666+
sudo installer -pkg $pkgpath -target /
667+
668+
- name: Validate
669+
shell: bash
670+
run: |
671+
"${{ matrix.component.command }}" --version | sed 's/git version //' >actual
672+
echo ${{ needs.prereqs.outputs.tag_version }} >expect
673+
cmp expect actual || exit 1
674+
675+
- name: Validate universal binary CPU architecture
676+
if: contains(matrix.component.os, 'macos')
677+
shell: bash
678+
run: |
679+
set -ex
680+
git version --build-options >actual
681+
cat actual
682+
grep "cpu: $(uname -m)" actual
683+
# End validate installers
684+
615685
create-github-release:
616686
runs-on: ubuntu-latest
617687
permissions:
618688
contents: write
619689
id-token: write # required for Azure login via OIDC
620690
needs:
691+
- validate-installers
621692
- create-linux-artifacts
622693
- create-macos-artifacts
623694
- windows_artifacts

0 commit comments

Comments
 (0)