#!/bin/bash
set -e

VERSION="0.2.3"
LDFLAGS="-X main.version=${VERSION}"

echo "Building EduBox Agent v${VERSION}..."

export PATH=$PATH:/usr/local/go/bin

GOOS=windows GOARCH=amd64 go build -ldflags "${LDFLAGS}" -o edubox-agent.exe .
echo "  edubox-agent.exe (Windows amd64)"

GOOS=linux GOARCH=amd64 go build -ldflags "${LDFLAGS}" -o edubox-agent .
echo "  edubox-agent (Linux amd64)"

GOOS=darwin GOARCH=amd64 go build -ldflags "${LDFLAGS}" -o edubox-agent-mac .
echo "  edubox-agent-mac (macOS amd64)"

echo "Done."
