Skip to content

Commit 7363256

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 8a24a5f commit 7363256

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
@@ -638,12 +638,83 @@ jobs:
638638
*.deb
639639
# End build and sign Debian package
640640

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

0 commit comments

Comments
 (0)