2024-07-21 16:29:16 +00:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
2024-07-21 16:33:05 +00:00
|
|
|
export GO=$(which go)
|
|
|
|
$GO version
|
2024-07-21 16:29:16 +00:00
|
|
|
|
|
|
|
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"
|
|
|
|
|
2024-07-21 16:33:05 +00:00
|
|
|
$GO mod vendor
|
|
|
|
$GO mod tidy
|
2024-07-21 16:29:16 +00:00
|
|
|
|
2024-07-21 16:33:05 +00:00
|
|
|
$GO build -o "$buildpath" -ldflags "-X main.version=$VERSION_STRING"
|
2024-07-21 16:29:16 +00:00
|
|
|
|
|
|
|
"$buildpath" -v
|
|
|
|
|