Skip to content

Commit

Permalink
add ldflags to goreleaser.yaml
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksandar Stojanov <[email protected]>
  • Loading branch information
losisin committed Oct 25, 2023
1 parent 34343ad commit 3dbf09a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ builds:
goarch:
- amd64
- arm64
ldflags:
- -s -w
-X main.Version={{ .Tag }}
-X main.GitCommit={{ .Commit }}
-X main.BuildDate={{ .Date }}
binary: schema

archives:
Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ BUILD_DATE := $(shell date -u '+%Y-%m-%d %I:%M:%S UTC' 2> /dev/null)
GIT_HASH := $(shell git rev-parse HEAD 2> /dev/null)

OS_FAMILY := $(shell (uname | tr '[:upper:]' '[:lower:]'))
OS_ARCH := $(shell (uname -m | tr '[:upper:]' '[:lower:]'))

GOPATH ?= $(shell go env GOPATH)
PATH := $(GOPATH)/bin:$(PATH)
GO_BUILD_ENV_VARS = $(if $(GO_ENV_VARS),$(GO_ENV_VARS),CGO_ENABLED=0 GOOS=${OS_FAMILY} GOARCH=${OS_ARCH})
GO_BUILD_ENV_VARS = $(if $(GO_ENV_VARS),$(GO_ENV_VARS),CGO_ENABLED=0 GOOS=${OS_FAMILY})
GO_BUILD_ARGS = -buildvcs=false -ldflags "-X main.GitCommit=${GIT_HASH}"

HELM_PLUGINS = $(shell helm env HELM_PLUGINS)
Expand Down Expand Up @@ -104,4 +103,4 @@ help: ## Show this help message
@echo " PLUGIN_SHORTNAME The short name of the plugin (default: $(PLUGIN_SHORTNAME))"
@echo ""

default: help
default: help

0 comments on commit 3dbf09a

Please sign in to comment.