-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy patharchive.sh
executable file
·59 lines (49 loc) · 972 Bytes
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh
set -e
dir="$(cd "$(dirname "$0")" && pwd)"
archive_name="$1"
output_dir="${dir}/pack"
os="$RUNNER_OS"
if [ -z "$os" ]; then
case "$(uname -s)" in
Linux)
os="Linux"
;;
Darwin)
os="macOS"
;;
*)
echo "Unknown OS type"
exit 1
esac
fi
if [ -z "$archive_name" ]; then
if [ -n "$RUNNER_ARCH" ]; then
arch="$(echo $RUNNER_ARCH | tr '[:upper:]' '[:lower:]')"
else
case "$(uname -m)" in
x86_64)
arch="x64"
;;
x86|i386|i686)
arch="x86"
;;
arm64|aarch64)
arch="arm64"
;;
arm*)
arch="arm"
;;
esac
fi
archive="v8_${os}_${arch}.tar.xz"
else
archive="${archive_name}.tar.xz"
fi
mkdir "$output_dir" || true
cp -r "${dir}/v8/include" \
"${dir}/v8/out/release/obj/libv8_monolith.a" \
"${dir}/gn-args_${os}.txt" \
"$output_dir"
tar -Jcf "${dir}/${archive}" -C "$output_dir" .
ls -lh "${dir}/${archive}"