@@ -25,6 +25,9 @@ export GOTOOLCHAIN=go1.22.8
25
25
export GO111MODULE =on
26
26
unexport GOPATH
27
27
28
+ # Go
29
+ GO_VERSION ?= 1.22.7
30
+
28
31
# Directories.
29
32
ARTIFACTS ?= $(REPO_ROOT ) /_artifacts
30
33
TOOLS_DIR := hack/tools
@@ -346,8 +349,25 @@ staging-manifests:
346
349
# #@ Release
347
350
# # --------------------------------------
348
351
352
+ ifneq (,$(findstring -,$(RELEASE_TAG ) ) )
353
+ PRE_RELEASE =true
354
+ endif
355
+ 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)
356
+ # # set by Prow, ref name of the base branch, e.g., main
357
+ RELEASE_DIR := out
358
+ RELEASE_NOTES_DIR := _releasenotes
359
+
360
+ .PHONY : $(RELEASE_DIR )
349
361
$(RELEASE_DIR ) :
350
- mkdir -p $@
362
+ mkdir -p $(RELEASE_DIR ) /
363
+
364
+ .PHONY : $(RELEASE_NOTES_DIR )
365
+ $(RELEASE_NOTES_DIR ) :
366
+ mkdir -p $(RELEASE_NOTES_DIR ) /
367
+
368
+ .PHONY : $(BUILD_DIR )
369
+ $(BUILD_DIR ) :
370
+ @mkdir -p $(BUILD_DIR )
351
371
352
372
.PHONY : list-staging-releases
353
373
list-staging-releases : # # List staging images for image promotion
@@ -422,9 +442,14 @@ upload-gh-artifacts: $(GH) ## Upload artifacts to Github release
422
442
release-alias-tag : # Adds the tag to the last build tag.
423
443
gcloud container images add-tag -q $(CONTROLLER_IMG ) :$(TAG ) $(CONTROLLER_IMG ) :$(RELEASE_ALIAS_TAG )
424
444
425
- .PHONY : release-notes
426
- release-notes : $(RELEASE_NOTES ) # # Generate release notes
427
- $(RELEASE_NOTES ) $(RELEASE_NOTES_ARGS )
445
+ .PHONY : generate-release-notes # # Generate release notes
446
+ generate-release-notes : $(RELEASE_NOTES_DIR ) $(RELEASE_NOTES )
447
+ # Reset the file
448
+ echo -n > $(RELEASE_NOTES_DIR ) /$(RELEASE_TAG ) .md
449
+ if [ -n " ${PRE_RELEASE} " ]; then \
450
+ 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; \
451
+ fi
452
+ " $( RELEASE_NOTES) " --from=$(PREVIOUS_TAG ) >> $(RELEASE_NOTES_DIR ) /$(RELEASE_TAG ) .md
428
453
429
454
.PHONY : templates
430
455
templates : # # Generate cluster templates
@@ -533,3 +558,12 @@ compile-e2e: ## Test e2e compilation
533
558
534
559
.PHONY : FORCE
535
560
FORCE :
561
+
562
+ # # --------------------------------------
563
+ # # Helpers
564
+ # # --------------------------------------
565
+
566
+ # #@ helpers:
567
+
568
+ go-version : # # Print the go version we use to compile our binaries and images
569
+ @echo $(GO_VERSION )
0 commit comments