-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·36 lines (24 loc) · 990 Bytes
/
build.sh
File metadata and controls
executable file
·36 lines (24 loc) · 990 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
#!/bin/bash
# Simple build script for gotoni binaries
set -e
VERSION=${1:-"latest"}
BUILD_DIR="dist"
echo "Building gotoni binaries..."
# Create build directory
mkdir -p $BUILD_DIR
# Build for current platform
echo "Building for $(go env GOOS)/$(go env GOARCH)..."
go build -o $BUILD_DIR/gotoni-$(go env GOOS)-$(go env GOARCH)$(go env GOEXE) .
# Build for common platforms
echo "Building for linux/amd64..."
GOOS=linux GOARCH=amd64 go build -o $BUILD_DIR/gotoni-linux-amd64 .
echo "Building for linux/arm64..."
GOOS=linux GOARCH=arm64 go build -o $BUILD_DIR/gotoni-linux-arm64 .
echo "Building for darwin/amd64..."
GOOS=darwin GOARCH=amd64 go build -o $BUILD_DIR/gotoni-darwin-amd64 .
echo "Building for darwin/arm64..."
GOOS=darwin GOARCH=arm64 go build -o $BUILD_DIR/gotoni-darwin-arm64 .
echo "Building for windows/amd64..."
GOOS=windows GOARCH=amd64 go build -o $BUILD_DIR/gotoni-windows-amd64.exe .
echo "Done! Binaries are in the $BUILD_DIR directory:"
ls -lh $BUILD_DIR/