Skip to content

Commit

Permalink
fix: version override during build (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
shini4i authored Jan 23, 2024
1 parent b5f55c2 commit 910baac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 910baac

Please sign in to comment.