-
Notifications
You must be signed in to change notification settings - Fork 191
/
build.sh
executable file
·76 lines (58 loc) · 1.93 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
function build_binary_rice {
name="$1"
for arch in amd64 386; do
GOOS=darwin GOARCH=$arch go build -o "$name"osx-$arch
rice append --exec "$name"osx-$arch
done
for arch in amd64 386; do
GOOS=freebsd GOARCH=$arch go build -o "$name"freebsd-$arch
rice append --exec "$name"freebsd-$arch
done
for arch in arm amd64 386; do
GOOS=netbsd GOARCH=$arch go build -o "$name"netbsd-$arch
rice append --exec "$name"netbsd-$arch
done
for arch in amd64 386; do
GOOS=openbsd GOARCH=$arch go build -o "$name"openbsd-$arch
rice append --exec "$name"openbsd-$arch
done
for arch in arm arm64 amd64 386; do
GOOS=linux GOARCH=$arch go build -o "$name"linux-$arch
rice append --exec "$name"linux-$arch
done
for arch in amd64 386; do
GOOS=windows GOARCH=$arch go build -o "$name"windows-$arch.exe
rice append --exec "$name"windows-$arch.exe
done
}
function build_binary {
name="$1"
for arch in amd64 386; do
GOOS=darwin GOARCH=$arch go build -o "$name"osx-$arch
done
for arch in amd64 386; do
GOOS=freebsd GOARCH=$arch go build -o "$name"freebsd-$arch
done
for arch in arm amd64 386; do
GOOS=netbsd GOARCH=$arch go build -o "$name"netbsd-$arch
done
for arch in amd64 386; do
GOOS=openbsd GOARCH=$arch go build -o "$name"openbsd-$arch
done
for arch in arm arm64 amd64 386; do
GOOS=linux GOARCH=$arch go build -o "$name"linux-$arch
done
for arch in amd64 386; do
GOOS=windows GOARCH=$arch go build -o "$name"windows-$arch.exe
done
}
version="$1"
mkdir -p "binaries/""$version"
build_binary_rice "binaries/""$version""/linx-server-v""$version""_"
cd linx-genkey
build_binary "../binaries/""$version""/linx-genkey-v""$version""_"
cd ..
cd linx-cleanup
build_binary "../binaries/""$version""/linx-cleanup-v""$version""_"
cd ..