gostations/ci-build.sh
Greg Gauthier 3ae9f2afa2
Some checks failed
gobuild / build (push) Failing after 8s
custom build script for gitea runner
2024-07-21 17:29:16 +01:00

23 lines
404 B
Bash
Executable File

#!/usr/bin/env sh
GO = $(which go)
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"
${GO} mod vendor
${GO} mod tidy
${GO} build -o "$buildpath" -ldflags "-X main.version=$VERSION_STRING"
"$buildpath" -v