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
|
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 }})
|
- name: Run ${{ matrix.task }} (${{ matrix.runtime }})
|
||||||
run: |
|
run: ${{ matrix.command }}
|
||||||
export PATH="/c/Program Files/Git/usr/bin:$PATH"
|
|
||||||
${{ matrix.command }}
|
|
||||||
|
|
||||||
checks-macos:
|
checks-macos:
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
|
|||||||
@ -30,11 +30,20 @@ collect_files() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
compute_hash() {
|
compute_hash() {
|
||||||
collect_files \
|
# Use sha256sum (more portable on Windows) or fall back to shasum
|
||||||
| LC_ALL=C sort -z \
|
if command -v sha256sum >/dev/null 2>&1; then
|
||||||
| xargs -0 shasum -a 256 \
|
collect_files \
|
||||||
| shasum -a 256 \
|
| LC_ALL=C sort -z \
|
||||||
| awk '{print $1}'
|
| 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)"
|
current_hash="$(compute_hash)"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user