-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·36 lines (31 loc) · 1.03 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
#!/bin/bash
BinaryName="SocksProxyViaJumpHost"
rm -rf ./bin/
# https://stackoverflow.com/questions/25051623/golang-compile-for-all-platforms-in-windows-7-32-bit
# https://www.digitalocean.com/community/tutorials/how-to-build-go-executables-for-multiple-platforms-on-ubuntu-16-04
declare -a linux_architectures=(
"amd64"
"arm"
"arm64"
)
declare -a darwin_architectures=(
"amd64"
)
declare -a windows_architectures=(
"amd64"
)
for architecture in "${linux_architectures[@]}"
do
echo "Building Linux: $architecture"
GOOS=linux GOARCH=$architecture go build -o bin/linux/$architecture/$BinaryName
done
for architecture in "${darwin_architectures[@]}"
do
echo "Building Darwin: $architecture"
GOOS=darwin GOARCH=$architecture go build -o bin/darwin/$architecture/$BinaryName
done
for architecture in "${windows_architectures[@]}"
do
echo "Building Windows: $architecture"
GOOS=windows GOARCH=$architecture go build -o bin/windows/$architecture/$BinaryName.exe
done