Skip to content

Commit 17c44f9

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 cb46a9b commit 17c44f9

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
@@ -717,12 +717,83 @@ jobs:
717717
*.deb
718718
# End build and sign Debian package
719719

720+
# Validate installers
721+
validate-installers:
722+
name: Validate installers
723+
strategy:
724+
matrix:
725+
component:
726+
- os: ubuntu-latest
727+
artifact: linux-artifacts
728+
command: git
729+
- os: macos-latest
730+
artifact: macos-artifacts
731+
command: git
732+
- os: macos-latest
733+
artifact: macos-artifacts
734+
command: git
735+
- os: windows-latest
736+
artifact: win-installer-x86_64
737+
command: $PROGRAMFILES\Git\cmd\git.exe
738+
- os: windows-11-arm
739+
artifact: win-installer-aarch64
740+
command: $PROGRAMFILES\Git\cmd\git.exe
741+
runs-on: ${{ matrix.component.os }}
742+
needs: [prereqs, windows_artifacts, create-macos-artifacts, create-linux-artifacts]
743+
steps:
744+
- name: Download artifacts
745+
uses: actions/download-artifact@v4
746+
with:
747+
name: ${{ matrix.component.artifact }}
748+
749+
- name: Install Windows
750+
if: contains(matrix.component.artifact, 'win-installer')
751+
shell: pwsh
752+
run: |
753+
$exePath = Get-ChildItem -Path ./*.exe | %{$_.FullName}
754+
Start-Process -Wait -FilePath "$exePath" -ArgumentList "/SILENT /VERYSILENT /NORESTART /SUPPRESSMSGBOXES /ALLOWDOWNGRADE=1"
755+
756+
- name: Install Linux
757+
if: contains(matrix.component.artifact, 'linux')
758+
run: |
759+
debpath=$(find ./*.deb)
760+
sudo apt install $debpath
761+
762+
- name: Install macOS
763+
if: contains(matrix.component.artifact, 'macos')
764+
run: |
765+
# avoid letting Homebrew's `git` in `/opt/homebrew/bin` override `/usr/local/bin/git`
766+
arch="$(uname -m)"
767+
test arm64 != "$arch" ||
768+
brew uninstall git
769+
770+
pkgpath=$(find ./*universal*.pkg)
771+
sudo installer -pkg $pkgpath -target /
772+
773+
- name: Validate
774+
shell: bash
775+
run: |
776+
"${{ matrix.component.command }}" --version | sed 's/git version //' >actual
777+
echo "${{ needs.prereqs.outputs.tag_version }}" | sed 's/-rc/.rc/g' >expect
778+
cmp expect actual || exit 1
779+
780+
- name: Validate universal binary CPU architecture
781+
if: contains(matrix.component.os, 'macos')
782+
shell: bash
783+
run: |
784+
set -ex
785+
git version --build-options >actual
786+
cat actual
787+
grep "cpu: $(uname -m)" actual
788+
# End validate installers
789+
720790
create-github-release:
721791
runs-on: ubuntu-latest
722792
permissions:
723793
contents: write
724794
id-token: write # required for Azure login via OIDC
725795
needs:
796+
- validate-installers
726797
- create-linux-artifacts
727798
- create-macos-artifacts
728799
- windows_artifacts

0 commit comments

Comments
 (0)