ci(windows): use sha256sum for cross-platform hash computation
This commit is contained in:
parent
eefdc3f3df
commit
c1e6bf8ead
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -272,9 +272,7 @@ jobs:
|
||||
pnpm install --frozen-lockfile --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true || pnpm install --frozen-lockfile --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true
|
||||
|
||||
- name: Run ${{ matrix.task }} (${{ matrix.runtime }})
|
||||
run: |
|
||||
export PATH="/c/Program Files/Git/usr/bin:$PATH"
|
||||
${{ matrix.command }}
|
||||
run: ${{ matrix.command }}
|
||||
|
||||
checks-macos:
|
||||
if: github.event_name == 'pull_request'
|
||||
|
||||
@ -30,11 +30,20 @@ collect_files() {
|
||||
}
|
||||
|
||||
compute_hash() {
|
||||
collect_files \
|
||||
| LC_ALL=C sort -z \
|
||||
| xargs -0 shasum -a 256 \
|
||||
| shasum -a 256 \
|
||||
| awk '{print $1}'
|
||||
# Use sha256sum (more portable on Windows) or fall back to shasum
|
||||
if command -v sha256sum >/dev/null 2>&1; then
|
||||
collect_files \
|
||||
| LC_ALL=C sort -z \
|
||||
| xargs -0 sha256sum \
|
||||
| sha256sum \
|
||||
| awk '{print $1}'
|
||||
else
|
||||
collect_files \
|
||||
| LC_ALL=C sort -z \
|
||||
| xargs -0 shasum -a 256 \
|
||||
| shasum -a 256 \
|
||||
| awk '{print $1}'
|
||||
fi
|
||||
}
|
||||
|
||||
current_hash="$(compute_hash)"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user