From dc28826bea9400b4f1e48b59ef7273ad6bc3626e Mon Sep 17 00:00:00 2001 From: xuzhougeng Date: Wed, 22 Apr 2026 17:22:20 +0800 Subject: [PATCH] fix(ci): use sha256sum on Linux/Windows, shasum on macOS The Release workflow's Windows build failed at the Package step because `shasum` is not available in Windows Git Bash on GitHub runners. macOS, on the other hand, ships `shasum` (Perl) but not `sha256sum`. Pick the right tool per OS so all three platforms produce an identical `.sha256` output line (` `). Repro: https://github.com/AI4S-YB/RustQC/actions/runs/24770337963 (run after merge of #1; Windows job failed with `shasum: command not found`). Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/release.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f174dd3..85f99e0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -171,8 +171,13 @@ jobs: fi cd .. - # SHA256 checksum (shasum is available in Git Bash on Windows runners). - shasum -a 256 "${ARCHIVE_FILE}" > "${ARCHIVE_FILE}.sha256" + # SHA256 checksum. macOS ships `shasum` (Perl) but no `sha256sum`; + # Linux and Windows Git Bash both have `sha256sum`. Pick by OS. + if [[ "$RUNNER_OS" == "macOS" ]]; then + shasum -a 256 "${ARCHIVE_FILE}" > "${ARCHIVE_FILE}.sha256" + else + sha256sum "${ARCHIVE_FILE}" > "${ARCHIVE_FILE}.sha256" + fi echo "archive=${ARCHIVE_FILE}" >> "$GITHUB_OUTPUT" echo "checksum=${ARCHIVE_FILE}.sha256" >> "$GITHUB_OUTPUT"