-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·38 lines (32 loc) · 941 Bytes
/
build.sh
File metadata and controls
executable file
·38 lines (32 loc) · 941 Bytes
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
#!/bin/bash
NAME="tpeek"
VERSION="1.0.0"
echo "Starting multi-platform build for $NAME $VERSION..."
# Linux
echo "Building for Linux..."
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o build/${NAME}-linux
if [ $? -eq 0 ]; then
echo "Build successful for Linux: ${NAME}-linux"
else
echo "Build failed for Linux"
exit 1
fi
# Windows
echo "Building for Windows..."
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o build/${NAME}-windows.exe
if [ $? -eq 0 ]; then
echo "Build successful for Windows: ${NAME}-windows.exe"
else
echo "Build failed for Windows"
exit 1
fi
# MacOS
echo "Building for MacOS..."
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o build/${NAME}-macos
if [ $? -eq 0 ]; then
echo "Build successful for MacOS: ${NAME}-macos"
else
echo "Build failed for MacOS"
exit 1
fi
echo "✅ Done! All binaries are in the 'build' folder."