forked from meshcloud/collie-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·33 lines (23 loc) · 839 Bytes
/
build.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
#!/usr/bin/env bash
set -e
version=$(git describe --tags)
sed -i "s/vDEVELOPMENT/$version/g" src/info.ts
# before we do anything else, ensure we typecheck fine
deno task check
cli_name="collie"
deno_flags=$(deno run flags.ts --quiet)
mkdir -p bin
compile_unix(){
target="$1"
deno compile $deno_flags --target "$target" --output "./bin/$cli_name-$target" src/main.ts
tar -C "./bin" -czvf "./bin/$cli_name-$target.tar.gz" "$cli_name-$target"
}
compile_windows(){
target="$1"
deno compile $deno_flags --target "$target" --output "./bin/$cli_name-$target" src/main.ts
# we currently don't tar gz windows binaries to maintain compatibility with out install.ps1 script
}
compile_unix "x86_64-unknown-linux-gnu"
compile_unix "x86_64-apple-darwin"
compile_unix "aarch64-apple-darwin"
compile_windows "x86_64-pc-windows-msvc"