-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.sh
executable file
·40 lines (37 loc) · 1.07 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
#!/bin/sh
ARCHS="darwin linux freebsd windows"
CMD_DIR="cmd/align"
BUILD_CMD="go build -v -o"
case "$1" in
"release")
echo "Building release..."
# cd ${CMD_DIR}
for arch in ${ARCHS}; do
cd ${CMD_DIR}
GOOS=${arch} GOARCH=amd64 ${BUILD_CMD} ../../bin/align-${arch}
cd ../..
tar -czvf bin/align-${arch}.tar.gz bin/align-${arch}
done
;;
"freebsd")
echo "Building binary for FreeBSD..."
cd ${CMD_DIR}
GOOS=freebsd GOARCH=amd64 ${BUILD_CMD} ../../bin/align-freebsd
;;
"darwin")
echo "Building binary for Darwin..."
cd ${CMD_DIR}
GOOS=darwin GOARCH=amd64 ${BUILD_CMD} ../../bin/align-darwin
;;
"linux")
echo "Building binary for Linux..."
cd ${CMD_DIR}
GOOS=linux GOARCH=amd64 ${BUILD_CMD} ../../bin/align-linux
;;
"windows")
echo "Building binary for Windows..."
cd ${CMD_DIR}
GOOS=windows GOARCH=amd64 ${BUILD_CMD} ../../bin/align-windows.exe
;;
esac
exit 0