Skip to content

Commit cfb1016

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 b38a9eb commit cfb1016

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
@@ -712,12 +712,83 @@ jobs:
712712
*.deb
713713
# End build and sign Debian package
714714

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+
715785
create-github-release:
716786
runs-on: ubuntu-latest
717787
permissions:
718788
contents: write
719789
id-token: write # required for Azure login via OIDC
720790
needs:
791+
- validate-installers
721792
- create-linux-artifacts
722793
- create-macos-artifacts
723794
- windows_artifacts

0 commit comments

Comments
 (0)