From 910baac1838477c0d2de0aa71f9c26d8930f63e1 Mon Sep 17 00:00:00 2001 From: Vadim Gedz Date: Tue, 23 Jan 2024 13:50:10 +0200 Subject: [PATCH] fix: version override during build (#240) --- .goreleaser.yaml | 2 +- Makefile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 3b3f80f5..0dc1b161 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -9,7 +9,7 @@ builds: env: - CGO_ENABLED=0 ldflags: - - -s -w -X server/router.version={{.Version}} + - -s -w -X github.com/shini4i/argo-watcher/cmd/argo-watcher/server.version={{.Version}} goos: - linux goarch: diff --git a/Makefile b/Makefile index fcb3cc67..5569881c 100644 --- a/Makefile +++ b/Makefile @@ -24,13 +24,13 @@ test: mocks ## Run tests .PHONY: build build: docs ## Build the binaries @echo "===> Building [$(CYAN)${VERSION}$(RESET)] version of [$(CYAN)argo-watcher$(RESET)] binary" - @CGO_ENABLED=0 go build -ldflags="-s -w -X server/router.version=${VERSION}" -o argo-watcher ./cmd/argo-watcher + @CGO_ENABLED=0 go build -ldflags="-s -w -X github.com/shini4i/argo-watcher/cmd/argo-watcher/server.version=${VERSION}" -o argo-watcher ./cmd/argo-watcher @echo "===> Done" .PHONY: kind-upload kind-upload: @echo "===> Building [$(CYAN)dev$(RESET)] version of [$(CYAN)argo-watcher$(RESET)] binary" - @CGO_ENABLED=0 GOARCH=arm64 GOOS=linux go build -ldflags="-s -w -X server/router.version=dev" -o argo-watcher ./cmd/argo-watcher + @CGO_ENABLED=0 GOARCH=arm64 GOOS=linux go build -ldflags="-s -w -X github.com/shini4i/argo-watcher/cmd/argo-watcher/server.version=dev" -o argo-watcher ./cmd/argo-watcher @echo "===> Building web UI" @cd web && npm run build @echo "===> Building [$(CYAN)argo-watcher$(RESET)] docker image"