-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
48 lines (45 loc) · 1.12 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
if [ -z "$1" ]
then
echo "Empty argument"
exit 1
fi
BIN_NAME=rdnx-cli
DARWIN=("amd64" "arm64")
LINUX=("amd64" "arm64")
WINDOWS=("amd64")
case $1 in
"darwin")
for arch in "${DARWIN[@]}"
do
FN="${BIN_NAME}_${1}_${arch}.tar.gz"
GOOS=$1 GOARCH=$arch go build -o "./release/${BIN_NAME}"
cd ./release
tar -czf $FN $BIN_NAME && shasum $FN
rm $BIN_NAME
cd ../
done
;;
"linux")
for arch in "${LINUX[@]}"
do
FN="${BIN_NAME}_${1}_${arch}.tar.gz"
GOOS=$1 GOARCH=$arch go build -o "./release/${BIN_NAME}"
cd ./release
tar -czf $FN $BIN_NAME && shasum $FN
rm $BIN_NAME
cd ../
done
;;
"windows")
for arch in "${WINDOWS[@]}"
do
FN="${BIN_NAME}_${1}_${arch}.tar.gz"
GOOS=$1 GOARCH=$arch go build -o "./release/${BIN_NAME}.exe"
cd ./release
tar -czf $FN "${BIN_NAME}.exe" && shasum $FN
rm "${BIN_NAME}.exe"
cd ../
done
;;
esac