project-ely/scripts/build-windows-static.sh

20 lines
404 B
Bash

#!/usr/bin/env sh
# This is intended to run in Git Bash on Windows.
# This builds a statically-linked release version of the binary ready to be deployed.
OUTPUT=project-ely
build(){
OS=$1
ARCH=$2
CGO_ENABLED=1 \
CC=gcc \
GOOS=$OS \
GOARCH=$ARCH \
go build -x -v -trimpath -tags static -ldflags="-s -w -H windowsgui" -o "${OUTPUT}-${OS}-${ARCH}.exe"
}
build windows amd64