-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·27 lines (22 loc) · 1.11 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
#!/bin/sh
bin_name=$1
GOOS=linux GOARCH=386 go build -ldflags="-s -w" -o ./dist/linux_386_${bin_name}
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o ./dist/linux_64_${bin_name}
GOOS=windows GOARCH=386 go build -ldflags="-s -w" -o ./dist/windows_386_${bin_name}.exe
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o ./dist/windows_64_${bin_name}.exe
GOOS=darwin GOARCH=386 go build -ldflags="-s -w" -o ./dist/darwin_386_${bin_name}
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o ./dist/darwin_64_${bin_name}
cd dist
mv linux_386_${bin_name} ${bin_name}
zip linux_386_${bin_name} ${bin_name} -qm
mv linux_64_${bin_name} ${bin_name}
zip linux_64_${bin_name} ${bin_name} -qm
mv windows_386_${bin_name}.exe ${bin_name}.exe
zip windows_386_${bin_name} ${bin_name}.exe -qm
mv windows_64_${bin_name}.exe ${bin_name}.exe
zip windows_64_${bin_name} ${bin_name}.exe -qm
mv darwin_386_${bin_name} ${bin_name}
zip darwin_386_${bin_name} ${bin_name} -qm
mv darwin_64_${bin_name} ${bin_name}
zip darwin_64_${bin_name} ${bin_name} -qm
cd -