#!/usr/bin/env bash # Build everything that gets deployed into dist/ (static linux binaries for amd64 and arm64). # scripts/build.sh # Output: dist/wxch-server (amd64, for the VPS) and dist/dl/wxch-{agent,runner}-{amd64,arm64} set -euo pipefail cd "$(dirname "$0")/.." export CGO_ENABLED=0 rm -rf dist && mkdir -p dist/dl go vet ./... go test -count=1 ./... GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o dist/wxch-server ./cmd/wxch-server for a in amd64 arm64; do GOOS=linux GOARCH=$a go build -trimpath -ldflags="-s -w" -o "dist/dl/wxch-agent-$a" ./cmd/wxch-agent GOOS=linux GOARCH=$a go build -trimpath -ldflags="-s -w" -o "dist/dl/wxch-runner-$a" ./cmd/wxch-runner done sha256sum dist/wxch-server dist/dl/*