forked from kinfkong/ikatago-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.sh
executable file
·48 lines (40 loc) · 1.22 KB
/
package.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
#!/bin/bash
SVR_VERSION=3.1.0
BIN_DIR=./bin
BINARY_NAME=ikatago-server
rm -rf $BIN_DIR && mkdir $BIN_DIR
# Mac OSX
OUTPUT_PATH=$BINARY_NAME-$SVR_VERSION-mac-osx
mkdir -p $BIN_DIR/$OUTPUT_PATH
GOOS=darwin GOARCH=amd64 go build -o $BIN_DIR/$OUTPUT_PATH/$BINARY_NAME
cd $BIN_DIR
zip -r $OUTPUT_PATH.zip $OUTPUT_PATH
cd - >/dev/null
# linux
OUTPUT_PATH=$BINARY_NAME-$SVR_VERSION-linux
mkdir -p $BIN_DIR/$OUTPUT_PATH
GOOS=linux GOARCH=amd64 go build -o $BIN_DIR/$OUTPUT_PATH/$BINARY_NAME
cd $BIN_DIR
zip -r $OUTPUT_PATH.zip $OUTPUT_PATH
cd - >/dev/null
# windows 64bit
OUTPUT_PATH=$BINARY_NAME-$SVR_VERSION-win64
mkdir -p $BIN_DIR/$OUTPUT_PATH
GOOS=windows GOARCH=amd64 go build -o $BIN_DIR/$OUTPUT_PATH/$BINARY_NAME.exe
cd $BIN_DIR
zip -r $OUTPUT_PATH.zip $OUTPUT_PATH
cd - >/dev/null
# windows 32bit
OUTPUT_PATH=$BINARY_NAME-$SVR_VERSION-win32
mkdir -p $BIN_DIR/$OUTPUT_PATH
GOOS=windows GOARCH=386 go build -o $BIN_DIR/$OUTPUT_PATH/$BINARY_NAME.exe
cd $BIN_DIR
zip -r $OUTPUT_PATH.zip $OUTPUT_PATH
cd - >/dev/null
# raspbian pi
OUTPUT_PATH=$BINARY_NAME-$SVR_VERSION-raspbian
mkdir -p $BIN_DIR/$OUTPUT_PATH
GOOS=linux GOARCH=arm go build -o $BIN_DIR/$OUTPUT_PATH/$BINARY_NAME
cd $BIN_DIR
zip -r $OUTPUT_PATH.zip $OUTPUT_PATH
cd - >/dev/null