31 lines
855 B
Bash
Executable File
31 lines
855 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
# Make sure we are in the script's directory
|
|
cd "$(dirname "$0")"
|
|
|
|
# Read version from version.go
|
|
VERSION_LINE=$(grep "var Version =" version.go)
|
|
VERSION=$(echo "$VERSION_LINE" | sed -E 's/.*"([^"]+)".*/\1/')
|
|
|
|
echo "🛠️ Compiling release binaries for version v$VERSION..."
|
|
mkdir -p bin
|
|
|
|
# macOS Intel
|
|
echo "🍏 Building macOS Intel (amd64)..."
|
|
GOOS=darwin GOARCH=amd64 go build -o bin/goca-darwin-amd64
|
|
|
|
# macOS Apple Silicon
|
|
echo "🍏 Building macOS Apple Silicon (arm64)..."
|
|
GOOS=darwin GOARCH=arm64 go build -o bin/goca-darwin-arm64
|
|
|
|
# Linux Intel
|
|
echo "🐧 Building Linux Intel (amd64)..."
|
|
GOOS=linux GOARCH=amd64 go build -o bin/goca-linux-amd64
|
|
|
|
# Windows Intel
|
|
echo "🏁 Building Windows Intel (amd64)..."
|
|
GOOS=windows GOARCH=amd64 go build -o bin/goca-windows-amd64.exe
|
|
|
|
echo "🎉 All release binaries built in bin/!"
|