11OAPICODEGEN_VERSION ?= v2.4.1
22GOLANGCI_LINT_VERSION ?= v2.1.6
33HELMDOCS_VERSION ?= v1.14.2
4+ GITCHGLOG_VERSION ?= v0.15.4
45
56CURRENT_DIR =$(shell pwd)
67HOST_OS? =$(shell go env GOOS)
@@ -41,6 +42,15 @@ lint: golangci-lint ## Run go lint
4142lint-fix : golangci-lint # # Run go lint fix
4243 ${GOLANGCI_LINT} run -v -c .golangci.yaml ./... --fix
4344
45+ # use https://github.com/git-chglog/git-chglog/
46+ .PHONY : changelog
47+ changelog : git-chglog # # generate changelog
48+ ifneq (${NEXT_RELEASE_TAG},)
49+ $(GITCHGLOG) --next-tag v${NEXT_RELEASE_TAG} -o CHANGELOG.md
50+ else
51+ $(GITCHGLOG) -o CHANGELOG.md
52+ endif
53+
4454# Run tests
4555test :
4656 go test ./... -coverprofile=coverage.out
@@ -65,6 +75,11 @@ HELMDOCS = $(LOCALBIN)/helm-docs
6575helmdocs : # # Download helm-docs locally if necessary.
6676 $(call go-install-tool,$(HELMDOCS ) ,github.com/norwoodj/helm-docs/cmd/helm-docs,$(HELMDOCS_VERSION ) )
6777
78+ GITCHGLOG = $(LOCALBIN ) /git-chglog
79+ .PHONY : git-chglog
80+ git-chglog : # # Download git-chglog locally if necessary.
81+ $(call go-install-tool,$(GITCHGLOG ) ,github.com/git-chglog/git-chglog/cmd/git-chglog,$(GITCHGLOG_VERSION ) )
82+
6883# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
6984# $1 - target path with name of binary
7085# $2 - package url which can be installed
0 commit comments