Skip to content

Commit 128b957

Browse files
authored
Merge pull request #5962 from fabriziopandini/make-release-notes-for-pre-releases
🌱 make release-notes for pre-releases
2 parents f7d30f4 + 42fe71d commit 128b957

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,9 @@ docker-build-e2e: ## Rebuild all Cluster API provider images to be used in the e
481481

482482
## latest git tag for the commit, e.g., v0.3.10
483483
RELEASE_TAG ?= $(shell git describe --abbrev=0 2>/dev/null)
484+
ifneq (,$(findstring -,$(RELEASE_TAG)))
485+
PRE_RELEASE=true
486+
endif
484487
# the previous release tag, e.g., v0.3.9, excluding pre-release tags
485488
PREVIOUS_TAG ?= $(shell git tag -l | grep -E "^v[0-9]+\.[0-9]+\.[0-9]+$$" | sort -V | grep -B1 $(RELEASE_TAG) | head -n 1 2>/dev/null)
486489
## set by Prow, ref name of the base branch, e.g., main
@@ -594,7 +597,11 @@ release-alias-tag: ## Add the release alias tag to the last build tag
594597

595598
.PHONY: release-notes
596599
release-notes: $(RELEASE_NOTES_DIR) $(RELEASE_NOTES)
597-
go run ./hack/tools/release/notes.go --from=$(PREVIOUS_TAG) > $(RELEASE_NOTES_DIR)/$(RELEASE_TAG).md
600+
if [ -n "${PRE_RELEASE}" ]; then \
601+
echo ":rotating_light: This is a RELEASE CANDIDATE. Use it only for testing purposes. If you find any bugs, file an [issue](https://github.com/kubernetes-sigs/cluster-api/issues/new)." > $(RELEASE_NOTES_DIR)/$(RELEASE_TAG).md; \
602+
else \
603+
go run ./hack/tools/release/notes.go --from=$(PREVIOUS_TAG) > $(RELEASE_NOTES_DIR)/$(RELEASE_TAG).md; \
604+
fi
598605

599606
.PHONY: docker-build-all
600607
docker-build-all: $(addprefix docker-build-,$(ALL_ARCH)) ## Build all the architecture docker images

0 commit comments

Comments
 (0)