@@ -23,6 +23,9 @@ include $(ROOT_DIR_RELATIVE)/common.mk
23
23
export GO111MODULE =on
24
24
unexport GOPATH
25
25
26
+ # Go
27
+ GO_VERSION ?= 1.22.7
28
+
26
29
# Directories.
27
30
ARTIFACTS ?= $(REPO_ROOT ) /_artifacts
28
31
TOOLS_DIR := hack/tools
@@ -378,8 +381,25 @@ staging-manifests:
378
381
# #@ Release
379
382
# # --------------------------------------
380
383
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 )
381
393
$(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 )
383
403
384
404
.PHONY : list-staging-releases
385
405
list-staging-releases : # # List staging images for image promotion
@@ -454,9 +474,14 @@ upload-gh-artifacts: $(GH) ## Upload artifacts to Github release
454
474
release-alias-tag : # Adds the tag to the last build tag.
455
475
gcloud container images add-tag -q $(CONTROLLER_IMG ) :$(TAG ) $(CONTROLLER_IMG ) :$(RELEASE_ALIAS_TAG )
456
476
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
460
485
461
486
.PHONY : templates
462
487
templates : # # Generate cluster templates
@@ -570,3 +595,12 @@ compile-e2e: ## Test e2e compilation
570
595
571
596
.PHONY : FORCE
572
597
FORCE :
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