-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
56 lines (41 loc) · 907 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
set -e
mkdir -p release
cd release
echo "\033[0;31mCreated /release directory.\033[0m"
build() {
os=$1
arch=$2
if [ ${os} = darwin ]; then
buildos="macos"
else
buildos=${os}
fi
if [ ${arch} = amd64 ]; then
buildarch="64bit"
else
buildarch="32bit"
fi
binary=steer
release="$binary-$buildos-$buildarch"
if [ ${os} = windows ]; then
binary="$binary.exe"
fi
env GOOS=${os} GOARCH=${arch} go build -v -o ${binary} ../steer.go
if [ ${os} = linux ]; then
tar czf "$release.tar.gz" "$binary"
else
zip "$release.zip" "$binary"
fi
rm -f ${binary}
echo "\033[0;31mCreated release for '$buildos' on '$buildarch'.\033[0m"
}
# MacOS
build darwin amd64
build darwin 386
# Linux
build linux amd64
build linux 386
# Windows
build windows amd64
build windows 386