-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmake_archive.sh
executable file
·44 lines (32 loc) · 984 Bytes
/
make_archive.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
#
# Usage
# Curent git commit
# ./make_archive.sh
#
# Release
# ./make_archive.sh 1.0
#
set -euo pipefail
unset LANG
COMMIT="$(git rev-parse --short HEAD)"
DATE="$(date +%F)"
VERSION="${1-$COMMIT}"
SHORT_VERSION="$VERSION"
LONG_VERSION="$VERSION $DATE"
cargo clean
cargo update
RUSTFLAGS="-C target-cpu=x86-64-v2" cargo +nightly-2024-03-10 zigbuild --release --target x86_64-unknown-linux-gnu.2.12
cross b --release --target x86_64-pc-windows-gnu --bin kpageflags-viewer
echo "$LONG_VERSION" > VERSION
ARCHIVE="linux-mem-$SHORT_VERSION.tar.xz"
tar -cJf "$ARCHIVE" \
--transform 's:target/x86_64-unknown-linux-gnu/release/::' \
--transform 's:target/x86_64-pc-windows-gnu/release/::' \
--transform "s:^:linux-mem-$SHORT_VERSION/:" \
README.md VERSION \
target/x86_64-unknown-linux-gnu/release/{memstats,procinfo,shmem,kpageflags-viewer} \
target/x86_64-pc-windows-gnu/release/kpageflags-viewer.exe \
proc_snap/snap.py
echo Done
ls -lh "$ARCHIVE"