-
Notifications
You must be signed in to change notification settings - Fork 1
/
gobuildall.sh
65 lines (47 loc) · 1.3 KB
/
gobuildall.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
#!/bin/bash
mkdir -p build/windows_x64 \
build/windows_x86 \
build/linux_x64 \
build/linux_x86 \
build/darwin_x64 \
build/darwin_x86 \
build/darwin_arm64
rootDir=`pwd`
if [ "$(uname -s)" = "Windows" ]; then
GO_EXE=go.exe
else
GO_EXE=go
fi
echo Building for Linux amd64
cd $rootDir/build/linux_x64
GOOS=linux GOARCH=amd64 $GO_EXE build ../.. &
echo Building for Linux 386
cd $rootDir/build/linux_x86
GOOS=linux GOARCH=386 GO386=softfloat $GO_EXE build ../.. &
echo Building for Windows amd64
cd $rootDir/build/windows_x64
GOOS=windows GOARCH=amd64 $GO_EXE build ../.. &
echo Building for Windows 386
cd $rootDir/build/windows_x86
GOOS=windows GOARCH=386 GO386=softfloat $GO_EXE build ../.. &
echo Building for Darwin amd64
cd $rootDir/build/darwin_x64
GOOS=darwin GOARCH=amd64 $GO_EXE build ../.. &
echo Building for Darwin 386
cd $rootDir/build/darwin_x86
GOOS=darwin GOARCH=386 GO386=softfloat $GO_EXE build ../.. &
echo Building for Darwin arm64
cd $rootDir/build/darwin_arm64
GOOS=darwin GOARCH=arm64 $GO_EXE build ../.. &
wait
echo Done building
cd $rootDir/build
for dir in */; do
dir=${dir:0:(-1)}
echo "Compressing $dir"
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on $dir.7z ./$dir/* > /dev/null &
7z a -mx=9 -mfb=64 $dir.zip ./$dir/* > /dev/null &
done
wait
echo Done compressing
cd $rootDir