diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index ad2f4647d..66335d47f 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -16,7 +16,9 @@ jobs: target: macos-arm64 - os: macos-15-intel target: macos-x86_64 - - os: ubuntu-latest + # PyInstaller Linux binaries inherit the builder's glibc baseline. + # Keep releases compatible with older LTS distributions. + - os: ubuntu-22.04 target: linux-x86_64 - os: windows-latest target: windows-x86_64 diff --git a/tests/test_build_release_workflow.py b/tests/test_build_release_workflow.py new file mode 100644 index 000000000..59d906951 --- /dev/null +++ b/tests/test_build_release_workflow.py @@ -0,0 +1,36 @@ +"""Tests for release workflow compatibility-sensitive settings.""" + +from __future__ import annotations + +from pathlib import Path + + +WORKFLOW = Path(__file__).resolve().parent.parent / ".github/workflows/build-release.yml" + + +def _matrix_entries() -> list[dict[str, str]]: + lines = WORKFLOW.read_text(encoding="utf-8").splitlines() + entries: list[dict[str, str]] = [] + current: dict[str, str] | None = None + + for raw_line in lines: + line = raw_line.strip() + if line.startswith("- os: "): + current = {"os": line.removeprefix("- os: ")} + entries.append(current) + elif current is not None and line.startswith("target: "): + current["target"] = line.removeprefix("target: ") + + return entries + + +def _runner_for_target(target: str) -> str: + for entry in _matrix_entries(): + if entry.get("target") == target: + return entry["os"] + msg = f"release matrix target not found: {target}" + raise AssertionError(msg) + + +def test_linux_release_binary_build_uses_older_glibc_baseline() -> None: + assert _runner_for_target("linux-x86_64") == "ubuntu-22.04"