@@ -23,6 +23,9 @@ include $(ROOT_DIR_RELATIVE)/common.mk
2323export GO111MODULE =on
2424unexport GOPATH
2525
26+ # Go
27+ GO_VERSION ?= 1.22.7
28+
2629# Directories.
2730ARTIFACTS ?= $(REPO_ROOT ) /_artifacts
2831TOOLS_DIR := hack/tools
@@ -378,8 +381,25 @@ staging-manifests:
378381# #@ Release
379382# # --------------------------------------
380383
384+ ifneq (,$(findstring -,$(RELEASE_TAG ) ) )
385+ PRE_RELEASE =true
386+ endif
387+ 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)
388+ # # set by Prow, ref name of the base branch, e.g., main
389+ RELEASE_DIR := out
390+ RELEASE_NOTES_DIR := _releasenotes
391+
392+ .PHONY : $(RELEASE_DIR )
381393$(RELEASE_DIR ) :
382- mkdir -p $@
394+ mkdir -p $(RELEASE_DIR ) /
395+
396+ .PHONY : $(RELEASE_NOTES_DIR )
397+ $(RELEASE_NOTES_DIR ) :
398+ mkdir -p $(RELEASE_NOTES_DIR ) /
399+
400+ .PHONY : $(BUILD_DIR )
401+ $(BUILD_DIR ) :
402+ @mkdir -p $(BUILD_DIR )
383403
384404.PHONY : list-staging-releases
385405list-staging-releases : # # List staging images for image promotion
@@ -454,9 +474,14 @@ upload-gh-artifacts: $(GH) ## Upload artifacts to Github release
454474release-alias-tag : # Adds the tag to the last build tag.
455475 gcloud container images add-tag -q $(CONTROLLER_IMG ) :$(TAG ) $(CONTROLLER_IMG ) :$(RELEASE_ALIAS_TAG )
456476
457- .PHONY : release-notes
458- release-notes : $(RELEASE_NOTES ) # # Generate release notes
459- $(RELEASE_NOTES ) $(RELEASE_NOTES_ARGS )
477+ .PHONY : generate-release-notes # # Generate release notes
478+ generate-release-notes : $(RELEASE_NOTES_DIR ) $(RELEASE_NOTES )
479+ # Reset the file
480+ echo -n > $(RELEASE_NOTES_DIR ) /$(RELEASE_TAG ) .md
481+ if [ -n " ${PRE_RELEASE} " ]; then \
482+ echo -e " :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-provider-openstack/issues/new/choose).\n" >> $(RELEASE_NOTES_DIR ) /$(RELEASE_TAG ) .md; \
483+ fi
484+ " $( RELEASE_NOTES) " --from=$(PREVIOUS_TAG ) >> $(RELEASE_NOTES_DIR ) /$(RELEASE_TAG ) .md
460485
461486.PHONY : templates
462487templates : # # Generate cluster templates
@@ -570,3 +595,12 @@ compile-e2e: ## Test e2e compilation
570595
571596.PHONY : FORCE
572597FORCE :
598+
599+ # # --------------------------------------
600+ # # Helpers
601+ # # --------------------------------------
602+
603+ # #@ helpers:
604+
605+ go-version : # # Print the go version we use to compile our binaries and images
606+ @echo $(GO_VERSION )
0 commit comments