File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
.github/actions/ccache-setup Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change 8585 DISTRO="windows"
8686 VERSION="nt$(powershell -Command "[System.Environment]::OSVersion.Version.Major")"
8787 else
88- DISTRO=$(lsb_release -is | tr '[:upper:]' '[:lower:]')
89- VERSION=$(lsb_release -rs)
88+ # Try lsb_release first, then fall back to /etc/os-release or /etc/redhat-release
89+ if command -v lsb_release &> /dev/null; then
90+ echo "Reading distro info from lsb_release"
91+ DISTRO=$(lsb_release -is | tr '[:upper:]' '[:lower:]')
92+ VERSION=$(lsb_release -rs)
93+ elif [ -f /etc/os-release ]; then
94+ echo "Reading distro info from /etc/os-release"
95+ DISTRO=$(. /etc/os-release && echo "$ID")
96+ VERSION=$(. /etc/os-release && echo "$VERSION_ID")
97+ elif [ -f /etc/redhat-release ]; then
98+ echo "Reading distro info from /etc/redhat-release"
99+ DISTRO="rhel"
100+ VERSION=$(grep -oE '[0-9]+\.[0-9]+' /etc/redhat-release | head -1)
101+ else
102+ echo "Could not detect distro, using fallback"
103+ DISTRO="linux"
104+ VERSION="unknown"
105+ fi
90106 fi
107+ echo "Detected: DISTRO=$DISTRO, VERSION=$VERSION"
91108 echo "distro=${DISTRO}-${VERSION}" >> "$GITHUB_OUTPUT"
92109
93110 # Get architecture (e.g., x86-64, arm64, x86-32)
You can’t perform that action at this time.
0 commit comments