From d75fea45acdf726dcd971e3a9d4064a1bf994e8d Mon Sep 17 00:00:00 2001 From: Robert Lemke Date: Wed, 14 Oct 2020 11:37:44 +0200 Subject: [PATCH] Set Local Beach version in Github build step --- .github/workflows/go.build.yaml | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.build.yaml b/.github/workflows/go.build.yaml index 1f5479c..165a079 100644 --- a/.github/workflows/go.build.yaml +++ b/.github/workflows/go.build.yaml @@ -37,7 +37,7 @@ jobs: os="$(echo $target | cut -d '/' -f1)" arch="$(echo $target | cut -d '/' -f2)" echo "--> Building project for: ${os}/${arch}" - GOOS=$os GOARCH=$arch CGO_ENABLED=0 go build -o beach . + GOOS=$os GOARCH=$arch CGO_ENABLED=0 go build -ldflags "-X github.com/flownative/localbeach/pkg/version.Version=${GITHUB_REF#refs/*/}" -o beach . zip "beach_${os}_${arch}.zip" beach ls -la done diff --git a/Makefile b/Makefile index 2b64191..b3c56dd 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ build: go generate -v go install -v - go build -v -o beach + go build -v -ldflags "-X github.com/flownative/localbeach/pkg/version.Version=dev" -o beach