📦 build: fix determinism in ptth_server builds

main
_ 2021-01-29 01:12:52 +00:00
parent 2422207d42
commit 33334afc2b
1 changed files with 9 additions and 1 deletions

View File

@ -10,6 +10,8 @@
set -euo pipefail
export LC_ALL="C"
TEMP_GIBBERISH="ptth_server_build_BIHWLQXQ"
DEST="$TEMP_GIBBERISH/ptth"
@ -25,5 +27,11 @@ cp target/release/ptth_server "$DEST/ptth_server"
(
cd "$TEMP_GIBBERISH" || exit
tar -cf "ptth_server.tar" ptth/
find ptth/ -print0 | \
sort -z | \
tar --mtime='1970-01-01' --no-recursion --null -T - -cf - > \
ptth_server.tar.temp
mv ptth_server.tar.temp ptth_server.tar
)