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.
This commit is contained in:
Lessley Dennington 2022-08-17 10:58:25 -07:00 коммит произвёл Johannes Schindelin
Родитель 368e4c1d16
Коммит 3e282e7105
1 изменённых файлов: 68 добавлений и 0 удалений

68
.github/workflows/build-git-installers.yml поставляемый
Просмотреть файл

@ -590,11 +590,79 @@ jobs:
*.deb
# End build and sign Debian package
# Validate installers
validate-installers:
name: Validate installers
strategy:
matrix:
component:
- os: ubuntu-latest
artifact: linux-artifacts
command: git
- os: macos-latest-xl-arm64
artifact: macos-artifacts
command: git
- os: macos-latest
artifact: macos-artifacts
command: git
- os: windows-latest
artifact: win-installer-x86_64
command: $PROGRAMFILES\Git\cmd\git.exe
runs-on: ${{ matrix.component.os }}
needs: [prereqs, windows_artifacts, create-macos-artifacts, create-linux-artifacts]
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: ${{ matrix.component.artifact }}
- name: Install Windows
if: contains(matrix.component.os, 'windows')
shell: pwsh
run: |
$exePath = Get-ChildItem -Path ./*.exe | %{$_.FullName}
Start-Process -Wait -FilePath "$exePath" -ArgumentList "/SILENT /VERYSILENT /NORESTART /SUPPRESSMSGBOXES /ALLOWDOWNGRADE=1"
- name: Install Linux
if: contains(matrix.component.os, 'ubuntu')
run: |
debpath=$(find ./*.deb)
sudo apt install $debpath
- name: Install macOS
if: contains(matrix.component.os, 'macos')
run: |
# avoid letting Homebrew's `git` in `/opt/homebrew/bin` override `/usr/local/bin/git`
arch="$(uname -m)"
test arm64 != "$arch" ||
brew uninstall git
pkgpath=$(find ./*universal*.pkg)
sudo installer -pkg $pkgpath -target /
- name: Validate
shell: bash
run: |
"${{ matrix.component.command }}" --version | sed 's/git version //' >actual
echo ${{ needs.prereqs.outputs.tag_version }} >expect
cmp expect actual || exit 1
- name: Validate universal binary CPU architecture
if: contains(matrix.component.os, 'macos')
shell: bash
run: |
set -ex
git version --build-options >actual
cat actual
grep "cpu: $(uname -m)" actual
# End validate installers
create-github-release:
runs-on: ubuntu-latest
permissions:
contents: write
needs:
- validate-installers
- create-linux-artifacts
- create-macos-artifacts
- windows_artifacts