From a139b5b566bd8b86ec52bd5439a4601b1ec4e2ed Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 7 May 2024 13:14:30 +0200 Subject: [PATCH 1/2] ci(release-minor): add `apm-` prefix and create release diff between patches (#13065) (cherry picked from commit 1f2c64ea7b8aaa68f8ab377d89a38f4e8528c9c9) # Conflicts: # release.mk --- release.mk | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/release.mk b/release.mk index 8ec98e10a91..db39e3eddac 100644 --- a/release.mk +++ b/release.mk @@ -39,6 +39,10 @@ PROJECT_PATCH_VERSION ?= $(shell echo $(RELEASE_VERSION) | cut -f3 -d.) PROJECT_OWNER ?= elastic RELEASE_TYPE ?= minor +<<<<<<< HEAD +======= +CURRENT_RELEASE ?= $(shell gh release list --exclude-drafts --exclude-pre-releases --limit 10 --json tagName --jq '.[].tagName|select(. | startswith("v$(PROJECT_MAJOR_VERSION)"))' | sed 's|v||g' | sort -r | head -n 1) +>>>>>>> 1f2c64ea7 (ci(release-minor): add `apm-` prefix and create release diff between patches (#13065)) RELEASE_BRANCH ?= $(PROJECT_MAJOR_VERSION).$(PROJECT_MINOR_VERSION) NEXT_PROJECT_MINOR_VERSION ?= $(PROJECT_MAJOR_VERSION).$(shell expr $(PROJECT_MINOR_VERSION) + 1).0 NEXT_RELEASE ?= $(RELEASE_BRANCH).$(shell expr $(PROJECT_PATCH_VERSION) + 1) @@ -78,6 +82,20 @@ https://github.com/elastic/apm-server/compare/$(RELEASE_BRANCH)\...main[View com ==== Added endef +## Changelog template for new minors +define CHANGELOG_MINOR_TMPL +[[apm-release-notes-$(RELEASE_BRANCH)]] +== APM version $(RELEASE_BRANCH) +* <> + +[float] +[[apm-release-notes-$(RELEASE_BRANCH).0]] +=== APM version $(RELEASE_BRANCH).0 + +https://github.com/elastic/apm-server/compare/v$(CURRENT_RELEASE)\...v$(RELEASE_BRANCH).0[View commits] + +endef + ####################### ## Public make goals ####################### @@ -141,8 +159,8 @@ rename-changelog: $(MAKE) common-changelog @echo ">> rename-changelog" echo "$$CHANGELOG_TMPL" > changelogs/head.asciidoc - @if ! grep -q 'release-notes-$(VERSION)' CHANGELOG.asciidoc ; then \ - awk "NR==2{print \"* <>\"}1" CHANGELOG.asciidoc > CHANGELOG.asciidoc.new; \ + @if ! grep -q 'apm-release-notes-$(VERSION)' CHANGELOG.asciidoc ; then \ + awk "NR==2{print \"* <>\"}1" CHANGELOG.asciidoc > CHANGELOG.asciidoc.new; \ mv CHANGELOG.asciidoc.new CHANGELOG.asciidoc ; \ fi @if ! grep -q '$(VERSION).asciidoc' CHANGELOG.asciidoc ; then \ @@ -158,16 +176,13 @@ update-changelog: $(SED) 's#head#$(VERSION)#g' CHANGELOG.asciidoc # Common changelog file steps -# TODO: changelogs/$(VERSION).asciidoc requires further manipulation to remove empty entries. .PHONY: common-changelog +export CHANGELOG_MINOR_TMPL common-changelog: VERSION=$${VERSION} common-changelog: @echo ">> common-changelog" - mv changelogs/head.asciidoc changelogs/$(VERSION).asciidoc - $(SED) 's#head#$(VERSION)#gI' changelogs/$(VERSION).asciidoc - $(SED) -E -e 's#(\...)main#\1$(VERSION)#g' changelogs/$(VERSION).asciidoc - awk "NR==5{print \"\n* <>\n\n[float]\n[[release-notes-$(VERSION).0]]\n=== APM version $(VERSION).0\"}1" changelogs/$(VERSION).asciidoc > changelogs/$(VERSION).asciidoc.new - mv changelogs/$(VERSION).asciidoc.new changelogs/$(VERSION).asciidoc + echo "$$CHANGELOG_MINOR_TMPL" > changelogs/$(VERSION).asciidoc + tail -n +6 changelogs/head.asciidoc >> changelogs/$(VERSION).asciidoc ## Update project documentation. .PHONY: update-docs From b63a040176ecf37970e233b8c1ef1ba7269b7624 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 7 May 2024 14:41:11 +0200 Subject: [PATCH 2/2] Update release.mk --- release.mk | 3 --- 1 file changed, 3 deletions(-) diff --git a/release.mk b/release.mk index db39e3eddac..06c2cc73aaf 100644 --- a/release.mk +++ b/release.mk @@ -39,10 +39,7 @@ PROJECT_PATCH_VERSION ?= $(shell echo $(RELEASE_VERSION) | cut -f3 -d.) PROJECT_OWNER ?= elastic RELEASE_TYPE ?= minor -<<<<<<< HEAD -======= CURRENT_RELEASE ?= $(shell gh release list --exclude-drafts --exclude-pre-releases --limit 10 --json tagName --jq '.[].tagName|select(. | startswith("v$(PROJECT_MAJOR_VERSION)"))' | sed 's|v||g' | sort -r | head -n 1) ->>>>>>> 1f2c64ea7 (ci(release-minor): add `apm-` prefix and create release diff between patches (#13065)) RELEASE_BRANCH ?= $(PROJECT_MAJOR_VERSION).$(PROJECT_MINOR_VERSION) NEXT_PROJECT_MINOR_VERSION ?= $(PROJECT_MAJOR_VERSION).$(shell expr $(PROJECT_MINOR_VERSION) + 1).0 NEXT_RELEASE ?= $(RELEASE_BRANCH).$(shell expr $(PROJECT_PATCH_VERSION) + 1)