gostations/ci-build.sh
Greg Gauthier c34bdf66f2
All checks were successful
gobuild / build (push) Successful in 30s
FINE. I'll hard code it.
2024-07-21 17:35:28 +01:00

21 lines
431 B
Bash
Executable File

#!/usr/bin/env sh
mkdir build
GIT_COMMIT=$(git rev-list -1 HEAD)
export GIT_COMMIT
CANONICAL_VERSION=$(cat ./VERSION)-$(uname)
export CANONICAL_VERSION
VERSION_STRING="$CANONICAL_VERSION-$GIT_COMMIT"
export VERSION_STRING
buildpath="build/$(uname)/gostations"
/usr/local/go/bin/go mod vendor
/usr/local/go/bin/go mod tidy
/usr/local/go/bin/go build -o "$buildpath" -ldflags "-X main.version=$VERSION_STRING"
"$buildpath" -v