Skip to content

Commit d8d9bd7

Browse files
authored
Merge pull request #4472 from richardcase/release_notes_gen
feat: use k/k tooling for release notes
2 parents 824389c + 98b89d2 commit d8d9bd7

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
@@ -174,6 +174,15 @@ $(GOLANGCI_LINT_BIN): $(GOLANGCI_LINT) ## Build a local copy of golangci-lint.
174174
$(GOLANGCI_LINT): # Build golangci-lint from tools folder.
175175
GOBIN=$(abspath $(BIN_DIR)) go install $(GOLANGCI_LINT_PKG)@$(GOLANGCI_LINT_VERSION)
176176

177+
RELEASE_NOTES_BIN := release-notes
178+
RELEASE_NOTES := $(BIN_DIR)/$(RELEASE_NOTES_BIN)
179+
RELEASE_NOTES_PKG := k8s.io/release/cmd/release-notes
180+
.PHONY: $(RELEASE_NOTES_BIN)
181+
$(RELEASE_NOTES_BIN): $(RELEASE_NOTES)
182+
183+
$(RELEASE_NOTES): ## Build release notes from tools folders.
184+
GOBIN=$(abspath $(BIN_DIR)) go install $(RELEASE_NOTES_PKG)@$(RELEASE_NOTES_VERSION)
185+
177186

178187
## ------------------------------------------------------------------------------------------------
179188
## 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 := v4.0.4
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)