custom build script for gitea runner
Some checks failed
gobuild / build (push) Failing after 8s

This commit is contained in:
Greg Gauthier 2024-07-21 17:29:16 +01:00
parent 767b1e8a7c
commit 3ae9f2afa2
2 changed files with 23 additions and 1 deletions

View File

@ -23,4 +23,4 @@ jobs:
&& go version && go version
- name: Linux Build - name: Linux Build
run: run:
./build.sh ./ci-build.sh

22
ci-build.sh Executable file
View File

@ -0,0 +1,22 @@
#!/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