mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-10-15 21:19:56 +00:00
* ci: build cache * update build job * rename steps, cache all builds, patch timestamps for ghc 8.10.7 * refactor, save O0 caches in master and stable builds * update build to include toolchain fingerprint * do not save cache on exact match * remove caching docker from prs --------- Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
28 lines
483 B
Bash
Executable File
28 lines
483 B
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
|
|
command=$1
|
|
hashes=$2
|
|
|
|
sources() {
|
|
git ls-files -z '*.hs' '*.hsc'
|
|
}
|
|
|
|
case "$command" in
|
|
record)
|
|
sources | xargs -0 sha256sum > "$hashes"
|
|
;;
|
|
restore)
|
|
sources | xargs -0 touch
|
|
while read -r hash file; do
|
|
if [ -f "$file" ] && [ "$(sha256sum "$file" | cut -d' ' -f1)" = "$hash" ]; then
|
|
touch -d 2000-01-01 "$file"
|
|
fi
|
|
done < "$hashes"
|
|
;;
|
|
*)
|
|
echo "usage: $0 record|restore <hashes file>" >&2
|
|
exit 1
|
|
;;
|
|
esac
|