Files
app/.github/workflows/release.yml
T
owenandClaude Sonnet 5 ec7e75e105 Fix CPU telemetry temperature/clock speed on Windows and macOS
sample_cpu_temperature() only ever had a Linux implementation, so
Windows and macOS runs recorded empty temperature data points for
every sample. sample_cpu_clock_mhz() on both platforms read a static
nominal frequency once (Windows: the ~MHz registry value; macOS: the
hw.cpufrequency sysctl) instead of a live reading, so clock speed
showed as a constant throughout the benchmark.

Windows: temperature now queries the ACPI thermal zone over WMI
(MSAcpi_ThermalZoneTemperature), and clock speed reads live per-core
frequency via CallNtPowerInformation(ProcessorInformation). Both are
XP-compatible (verified via mingw cross-compile with the existing
windows-i386 XP toolchain/PE checks).

macOS: temperature reads the SMC directly (AppleSMC user client),
checking known CPU sensor keys across Intel and Apple Silicon
(M1-M5). There is no live-frequency API on macOS at all (Apple
Silicon has none, and hw.cpufrequency was always a fixed nominal
value even on Intel), so clock speed now reports as unavailable
instead of a misleading constant.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PcL8rcwwBeD6W3fZFCRLss
2026-07-21 01:13:33 -05:00

180 lines
6.1 KiB
YAML

name: Build and release
on:
push:
tags:
- '**'
permissions:
contents: read
jobs:
test:
name: Test (${{ matrix.os }})
strategy:
matrix:
os:
- ubuntu-24.04
- macos-14
runs-on: ${{ matrix.os }}
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Run kernel correctness tests
run: make test
build:
name: Build ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
include:
- target: linux-amd64
os: ubuntu-24.04
- target: linux-i386
os: ubuntu-24.04
- target: linux-arm64
os: ubuntu-24.04-arm
- target: linux-ppc32be
os: ubuntu-24.04
- target: macos-amd64
os: macos-14
- target: macos-arm64
os: macos-14
- target: windows-amd64
os: ubuntu-24.04
- target: windows-i386
os: ubuntu-24.04
runs-on: ${{ matrix.os }}
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Install the Linux i386 multilib compiler
if: matrix.target == 'linux-i386'
run: |
sudo apt-get update
sudo apt-get install --yes gcc-multilib
- name: Install the Linux PPC32 big-endian cross-compiler
if: matrix.target == 'linux-ppc32be'
run: |
sudo apt-get update
sudo apt-get install --yes gcc-powerpc-linux-gnu
- name: Install the Windows/AMD64 cross-compiler
if: matrix.target == 'windows-amd64'
run: |
sudo apt-get update
sudo apt-get install --yes gcc-mingw-w64-x86-64
- name: Install the Windows/i386 cross-compiler
if: matrix.target == 'windows-i386'
run: |
sudo apt-get update
sudo apt-get install --yes gcc-mingw-w64-i686
- name: Build Linux executable
if: startsWith(matrix.target, 'linux-')
run: |
make "${{ matrix.target }}"
file "dist/fossbench-${{ matrix.target }}"
if ! file "dist/fossbench-${{ matrix.target }}" | grep -q 'dynamically linked'; then
echo 'Linux release uses static glibc, which is unsafe with NSS-based DNS' >&2
exit 1
fi
if [ "${{ matrix.target }}" != linux-ppc32be ]; then
"dist/fossbench-${{ matrix.target }}" --help
fi
- name: Build macOS executable
if: startsWith(matrix.target, 'macos-')
env:
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.target == 'macos-amd64' && '10.5' || '' }}
run: |
build_log="$(mktemp)"
if ! make "${{ matrix.target }}" >"$build_log" 2>&1; then
cat "$build_log"
{
echo '## macOS build failure'
echo '```text'
tail -80 "$build_log"
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
exit 1
fi
cat "$build_log"
- name: Build Windows executable
if: startsWith(matrix.target, 'windows-')
run: |
make "${{ matrix.target }}"
file "dist/fossbench-${{ matrix.target }}.exe"
if [ "${{ matrix.target }}" = windows-i386 ]; then
pe="dist/fossbench-windows-i386.exe"
i686-w64-mingw32-objdump -p "$pe" > "$RUNNER_TEMP/windows-i386-pe.txt"
grep -Eq 'MajorSubsystemVersion[[:space:]]+5' "$RUNNER_TEMP/windows-i386-pe.txt"
grep -Eq 'MinorSubsystemVersion[[:space:]]+1' "$RUNNER_TEMP/windows-i386-pe.txt"
if grep -Eq 'GetTickCount64|InitializeCriticalSectionEx|CreateThreadpool|WaitOnAddress' "$RUNNER_TEMP/windows-i386-pe.txt"; then
echo 'Windows i386 release imports an API newer than Windows XP' >&2
exit 1
fi
fi
- name: Package artifact
run: |
bin="fossbench-${{ matrix.target }}"
if [[ "${{ matrix.target }}" == windows-* ]]; then
bin="$bin.exe"
fi
if [[ "${{ matrix.target }}" == linux-* ]]; then
tar -czf "$GITHUB_WORKSPACE/fossbench-${{ matrix.target }}.tar.gz" \
-C "$GITHUB_WORKSPACE/dist" "$bin"
else
(cd "$GITHUB_WORKSPACE/dist" && zip -q "$GITHUB_WORKSPACE/fossbench-${{ matrix.target }}.zip" "$bin")
fi
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: fossbench-${{ matrix.target }}
path: fossbench-${{ matrix.target }}.*
if-no-files-found: error
release:
name: Create GitHub release
needs:
- test
- build
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
pattern: fossbench-*
path: release
merge-multiple: true
- name: Create checksums
working-directory: release
run: sha256sum fossbench-*.tar.gz fossbench-*.zip > SHA256SUMS
- name: Create release and attach artifacts
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ github.ref_name }}
run: |
gh release delete "$RELEASE_TAG" \
--repo "$GITHUB_REPOSITORY" \
--yes 2>/dev/null || true
gh release create "$RELEASE_TAG" \
release/fossbench-*.tar.gz release/fossbench-*.zip \
release/SHA256SUMS \
--repo "$GITHUB_REPOSITORY" \
--title "Release $RELEASE_TAG" \
--notes "Hotfix: CPU telemetry (temperature and clock speed) recorded during benchmark runs was not working on Windows or macOS, showing empty temperature data points and a constant clock speed. Windows temperature now reads the ACPI thermal zone over WMI, and clock speed reads live per-core frequency via CallNtPowerInformation instead of a static registry value. macOS temperature now reads the SMC directly across Intel and Apple Silicon (M1-M5) Macs. macOS clock speed now reports as unavailable rather than the fixed nominal frequency it previously showed, since no live-frequency API exists on macOS." \
--generate-notes