-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-all-platforms.sh
executable file
·61 lines (55 loc) · 1.45 KB
/
build-all-platforms.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
#!/bin/bash
if [ -z "$1" ]
then
echo "≫ Error: enter a version, e.g. 1.0"
exit 1
fi
version=$1
rm -rf build
# Windows
echo "≫ Building Windows binaries..."
GOOS=windows GOARCH=arm64 go build -o build/tn-cli.exe .
cd build
tar -czvf "tn-cli-$version-windows-arm64.tar.gz" tn-cli.exe &> /dev/null
rm tn-cli.exe
cd ..
GOOS=windows GOARCH=amd64 go build -o build/tn-cli.exe .
cd build
tar -czvf "tn-cli-$version-windows-x86_64.tar.gz" tn-cli.exe &> /dev/null
rm tn-cli.exe
cd ..
GOOS=windows GOARCH=386 go build -o build/tn-cli.exe .
cd build
tar -czvf "tn-cli-$version-windows-386.tar.gz" tn-cli.exe &> /dev/null
rm tn-cli.exe
cd ..
# macOS - Darwin
echo "≫ Building macOS - Darwin binaries..."
GOOS=darwin GOARCH=arm64 go build -o build/tn-cli .
cd build
tar -czvf "tn-cli-$version-darwin-arm64.tar.gz" tn-cli &> /dev/null
rm tn-cli
cd ..
GOOS=darwin GOARCH=amd64 go build -o build/tn-cli .
cd build
tar -czvf "tn-cli-$version-darwin-x86_64.tar.gz" tn-cli &> /dev/null
rm tn-cli
cd ..
# Linux
echo "≫ Building Linux binaries..."
GOOS=linux GOARCH=arm64 go build -o build/tn-cli .
cd build
tar -czvf "tn-cli-$version-linux-arm64.tar.gz" tn-cli &> /dev/null
rm tn-cli
cd ..
GOOS=linux GOARCH=amd64 go build -o build/tn-cli .
cd build
tar -czvf "tn-cli-$version-linux-x86_64.tar.gz" tn-cli &> /dev/null
rm tn-cli
cd ..
GOOS=linux GOARCH=386 go build -o build/tn-cli .
cd build
tar -czvf "tn-cli-$version-linux-386.tar.gz" tn-cli &> /dev/null
rm tn-cli
cd ..
echo "Done."