Files
goca/build_releases.sh
T

31 lines
861 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 dist
# macOS Intel
echo "🍏 Building macOS Intel (amd64)..."
GOOS=darwin GOARCH=amd64 go build -o dist/goca-darwin-amd64
# macOS Apple Silicon
echo "🍏 Building macOS Apple Silicon (arm64)..."
GOOS=darwin GOARCH=arm64 go build -o dist/goca-darwin-arm64
# Linux Intel
echo "🐧 Building Linux Intel (amd64)..."
GOOS=linux GOARCH=amd64 go build -o dist/goca-linux-amd64
# Windows Intel
echo "🏁 Building Windows Intel (amd64)..."
GOOS=windows GOARCH=amd64 go build -o dist/goca-windows-amd64.exe
echo "🎉 All release binaries built in dist/!"