Skip to content

Commit af4feda

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 da6b256 commit af4feda

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

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

0 commit comments

Comments
 (0)