Skip to content

Commit ef80584

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 2f4cb35 commit ef80584

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

.github/workflows/build-git-installers.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,12 +595,80 @@ jobs:
595595
*.deb
596596
# End build and sign Debian package
597597

598+
# Validate installers
599+
validate-installers:
600+
name: Validate installers
601+
strategy:
602+
matrix:
603+
component:
604+
- os: ubuntu-latest
605+
artifact: linux-artifacts
606+
command: git
607+
- os: macos-latest-xl-arm64
608+
artifact: macos-artifacts
609+
command: git
610+
- os: macos-latest
611+
artifact: macos-artifacts
612+
command: git
613+
- os: windows-latest
614+
artifact: win-installer-x86_64
615+
command: $PROGRAMFILES\Git\cmd\git.exe
616+
runs-on: ${{ matrix.component.os }}
617+
needs: [prereqs, windows_artifacts, create-macos-artifacts, create-linux-artifacts]
618+
steps:
619+
- name: Download artifacts
620+
uses: actions/download-artifact@v4
621+
with:
622+
name: ${{ matrix.component.artifact }}
623+
624+
- name: Install Windows
625+
if: contains(matrix.component.os, 'windows')
626+
shell: pwsh
627+
run: |
628+
$exePath = Get-ChildItem -Path ./*.exe | %{$_.FullName}
629+
Start-Process -Wait -FilePath "$exePath" -ArgumentList "/SILENT /VERYSILENT /NORESTART /SUPPRESSMSGBOXES /ALLOWDOWNGRADE=1"
630+
631+
- name: Install Linux
632+
if: contains(matrix.component.os, 'ubuntu')
633+
run: |
634+
debpath=$(find ./*.deb)
635+
sudo apt install $debpath
636+
637+
- name: Install macOS
638+
if: contains(matrix.component.os, 'macos')
639+
run: |
640+
# avoid letting Homebrew's `git` in `/opt/homebrew/bin` override `/usr/local/bin/git`
641+
arch="$(uname -m)"
642+
test arm64 != "$arch" ||
643+
brew uninstall git
644+
645+
pkgpath=$(find ./*universal*.pkg)
646+
sudo installer -pkg $pkgpath -target /
647+
648+
- name: Validate
649+
shell: bash
650+
run: |
651+
"${{ matrix.component.command }}" --version | sed 's/git version //' >actual
652+
echo ${{ needs.prereqs.outputs.tag_version }} >expect
653+
cmp expect actual || exit 1
654+
655+
- name: Validate universal binary CPU architecture
656+
if: contains(matrix.component.os, 'macos')
657+
shell: bash
658+
run: |
659+
set -ex
660+
git version --build-options >actual
661+
cat actual
662+
grep "cpu: $(uname -m)" actual
663+
# End validate installers
664+
598665
create-github-release:
599666
runs-on: ubuntu-latest
600667
permissions:
601668
contents: write
602669
id-token: write # required for Azure login via OIDC
603670
needs:
671+
- validate-installers
604672
- create-linux-artifacts
605673
- create-macos-artifacts
606674
- windows_artifacts

0 commit comments

Comments
 (0)