Skip to content

Commit 98b89d2

Browse files
committed
feat: use k/k tooling for release notes
This change moves us back to using the k/k releas-notes tool to generate our changelog for a release. Signed-off-by: Richard Case <[email protected]>
1 parent 81566e4 commit 98b89d2

File tree

5 files changed

+41
-72
lines changed

5 files changed

+41
-72
lines changed

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ MOCKGEN := $(TOOLS_BIN_DIR)/mockgen
6565
SSM_PLUGIN := $(TOOLS_BIN_DIR)/session-manager-plugin
6666
YQ := $(TOOLS_BIN_DIR)/yq
6767
KPROMO := $(TOOLS_BIN_DIR)/kpromo
68+
RELEASE_NOTES := $(TOOLS_BIN_DIR)/release-notes
69+
6870
CLUSTERAWSADM_SRCS := $(call rwildcard,.,cmd/clusterawsadm/*.*)
6971

7072
PATH := $(abspath $(TOOLS_BIN_DIR)):$(PATH)
@@ -577,8 +579,8 @@ release-manifests: ## Release manifest files
577579
cp metadata.yaml $(RELEASE_DIR)/metadata.yaml
578580

579581
.PHONY: release-changelog
580-
release-changelog: $(GH) ## Generates release notes using Github release notes.
581-
./hack/releasechangelog.sh -v $(VERSION) -p $(PREVIOUS_VERSION) -o $(GH_ORG_NAME) -r $(GH_REPO_NAME) -c $(CORE_CONTROLLER_PROMOTED_IMG) > $(RELEASE_DIR)/CHANGELOG.md
582+
release-changelog: $(RELEASE_NOTES) check-release-tag check-previous-release-tag check-github-token $(RELEASE_DIR)
583+
$(RELEASE_NOTES) --debug --org $(GH_ORG_NAME) --repo $(GH_REPO_NAME) --start-sha $(shell git rev-list -n 1 ${PREVIOUS_VERSION}) --end-sha $(shell git rev-list -n 1 ${RELEASE_TAG}) --output $(RELEASE_DIR)/CHANGELOG.md --go-template go-template:$(REPO_ROOT)/hack/changelog.tpl --dependencies=true
582584

583585
.PHONY: promote-images
584586
promote-images: $(KPROMO) $(YQ)

hack/changelog.tpl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Release notes for Cluster API Provider AWS (CAPA) <RELEASE_VERSION>
2+
3+
[Documentation](https://cluster-api-aws.sigs.k8s.io/)
4+
5+
# Changelog since <PREVIOUS_VERSION>
6+
7+
{{with .NotesWithActionRequired -}}
8+
## Urgent Upgrade Notes
9+
10+
### (No, really, you MUST read this before you upgrade)
11+
12+
{{range .}}{{println "-" .}} {{end}}
13+
{{end}}
14+
15+
{{- if .Notes -}}
16+
## Changes by Kind
17+
{{ range .Notes}}
18+
### {{.Kind | prettyKind}}
19+
20+
{{range $note := .NoteEntries }}{{println "-" $note}}{{end}}
21+
{{- end -}}
22+
{{- end }}
23+
24+
The images for this release are:
25+
<ADD_IMAGE_HERE>
26+
27+
Thanks to all our contributors.

hack/releasechangelog.sh

Lines changed: 0 additions & 70 deletions
This file was deleted.

hack/tools/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,15 @@ $(GOLANGCI_LINT_BIN): $(GOLANGCI_LINT) ## Build a local copy of golangci-lint.
170170
$(GOLANGCI_LINT): # Build golangci-lint from tools folder.
171171
GOBIN=$(abspath $(BIN_DIR)) go install $(GOLANGCI_LINT_PKG)@$(GOLANGCI_LINT_VERSION)
172172

173+
RELEASE_NOTES_BIN := release-notes
174+
RELEASE_NOTES := $(BIN_DIR)/$(RELEASE_NOTES_BIN)
175+
RELEASE_NOTES_PKG := k8s.io/release/cmd/release-notes
176+
.PHONY: $(RELEASE_NOTES_BIN)
177+
$(RELEASE_NOTES_BIN): $(RELEASE_NOTES)
178+
179+
$(RELEASE_NOTES): ## Build release notes from tools folders.
180+
GOBIN=$(abspath $(BIN_DIR)) go install $(RELEASE_NOTES_PKG)@$(RELEASE_NOTES_VERSION)
181+
173182

174183
## ------------------------------------------------------------------------------------------------
175184
## AWS Session Manager Plugin Installation. Currently support Linux and MacOS AMD64 architectures.

versions.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ CAPI_VERSION := v1.4.4
2020
KPROMO_VERSION := v3.6.0
2121
YQ_VERSION := v4.25.2
2222
GOLANGCI_LINT_VERSION := v1.52.2
23+
RELEASE_NOTES_VERSION := v0.11.0

0 commit comments

Comments
 (0)