diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7e10d0d483..2005941571 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -152,6 +152,7 @@ jobs: git clone --bare --depth=1 --single-branch --branch=main $partial \ https://github.com/git-for-windows/git-sdk-${{ matrix.bitness }} .sdk - name: build ${{ matrix.artifact }} artifact + id: build-artifact shell: bash run: | case "${{ matrix.artifact }}" in @@ -166,6 +167,7 @@ jobs: ${{ matrix.artifact }} ;; esac && + echo "git-version=$(sdk-artifact/cmd/git.exe version)" >>$GITHUB_OUTPUT && cygpath -aw "$PWD/sdk-artifact/usr/bin/core_perl" >>$GITHUB_PATH && cygpath -aw "$PWD/sdk-artifact/usr/bin" >>$GITHUB_PATH && cygpath -aw "$PWD/sdk-artifact/mingw${{ matrix.bitness }}/bin" >>$GITHUB_PATH && @@ -184,18 +186,34 @@ jobs: shell: pwsh run: | $exePath = Get-ChildItem -Path installer-${{ matrix.bitness }}/*.exe | %{$_.FullName} - Start-Process -Wait -FilePath "$exePath" -ArgumentList "/SILENT /VERYSILENT /NORESTART /SUPPRESSMSGBOXES /ALLOWDOWNGRADE=1 /LOG=installer.log" - "$env:ProgramFiles\Git\usr\bin" | Out-File -Encoding ascii -Append $env:GITHUB_PATH - "$env:ProgramFiles\Git\mingw${{env.ARCH_BITNESS}}\bin" | Out-File -Encoding ascii -Append $env:GITHUB_PATH + $installer = Start-Process -PassThru -Wait -FilePath "$exePath" -ArgumentList "/SILENT /VERYSILENT /NORESTART /SUPPRESSMSGBOXES /ALLOWDOWNGRADE=1 /ALLOWINSTALLING32ON64=1 /LOG=installer.log" + $exitCode = $installer.ExitCode + if ($exitCode -ne 0) { + Write-Host "::error::Installer failed with exit code $exitCode!" + exit 1 + } + if ("${{ matrix.bitness }}" -eq 32) { + "${env:ProgramFiles(x86)}\Git\usr\bin" | Out-File -Encoding ascii -Append $env:GITHUB_PATH + "${env:ProgramFiles(x86)}\Git\mingw32\bin" | Out-File -Encoding ascii -Append $env:GITHUB_PATH + } else { + "$env:ProgramFiles\Git\usr\bin" | Out-File -Encoding ascii -Append $env:GITHUB_PATH + "$env:ProgramFiles\Git\mingw${{env.ARCH_BITNESS}}\bin" | Out-File -Encoding ascii -Append $env:GITHUB_PATH + } - name: validate if: matrix.artifact == 'build-installers' shell: bash run: | + echo '::group::installer.log' + cat installer.log + echo '::endgroup' + set -x && + grep 'Installation process succeeded' installer.log && + ! grep -iw failed installer.log && cygpath -aw / && git.exe version --build-options >version && cat version && - grep "$(sed -e 's|^v||' -e 's|-|.|g' &2 + exit 1 +} + +pcon_choice="$(sed -n 's/^Enable Pseudo Console Support: //p' /etc/install-options.txt)" || +die 'Could not read /etc/install-options.txt' + +if test -n "$pcon_choice" +then + pcon_config="$(cat /etc/git-bash.config)" || + die 'Could not read /etc/git-bash.config' + + case "$pcon_choice" in + Enabled) + test "MSYS=enable_pcon" = "$pcon_config" || + die "Expected enable_pcon in git-bash.config, but got '$pcon_config'" + ;; + Disabled) + test "MSYS=disable_pcon" = "$pcon_config" || + die "Expected disable_pcon in git-bash.config, but got '$pcon_config'" + ;; + *) + die "Unexpected Pseudo Console choice: $pcon_choice" + ;; + esac +fi + echo "All checks passed!" >&2