From 03a70c4d6fd9b6608ef3f1957b55c38f7767942d Mon Sep 17 00:00:00 2001 From: Kong Team Gateway Bot <98048765+team-gateway-bot@users.noreply.github.com> Date: Wed, 20 Mar 2024 20:40:04 -0700 Subject: [PATCH] chore(release): simplify changelog automation (#12769) FTI-5842 (cherry picked from commit ed0b96de49da824d76122cbaf7fc15060405afe5) Co-authored-by: Zachary Hu <6426329+outsinre@users.noreply.github.com> --- changelog/Makefile | 62 ++++++++++++++++------------------------------ 1 file changed, 21 insertions(+), 41 deletions(-) diff --git a/changelog/Makefile b/changelog/Makefile index d7cd67bdace3..68a9b9e9132a 100644 --- a/changelog/Makefile +++ b/changelog/Makefile @@ -40,7 +40,7 @@ check_version: fi create_branch: - @git fetch + @git fetch --prune @git submodule update --init --recursive @git checkout -B $(BRANCH_NAME) $(ORIGIN_BRANCH) @@ -48,47 +48,27 @@ generate: @rm -f $(VERSION).md @touch $(VERSION).md - @if [ -d "$(UNRELEASED_DIR)/kong" ] && [ -n "$$(shopt -s nullglob; echo $(UNRELEASED_DIR)/kong/*.yml)" ] ; then \ - if [ -f "$(VERSION)/$(VERSION).md" ]; then \ - changelog --debug=$(DEBUG) generate \ - --repo-path . \ - --changelog-paths $(VERSION)/kong,$(UNRELEASED_DIR)/kong \ - --title Kong \ - --github-issue-repo $(OWNER_REPO) \ - --github-api-repo $(OWNER_REPO) \ - --with-jiras \ - >> $(VERSION).md; \ - else \ - changelog --debug=$(DEBUG) generate \ - --repo-path . \ - --changelog-paths $(UNRELEASED_DIR)/kong \ - --title Kong \ - --github-issue-repo $(OWNER_REPO) \ - --github-api-repo $(OWNER_REPO) \ - --with-jiras \ - >> $(VERSION).md; \ - fi \ + @if [ -n "$$(shopt -s nullglob; echo $(UNRELEASED_DIR)/kong/*.yml)" ] || \ + [ -n "$$(shopt -s nullglob; echo $(VERSION)/kong/*.yml)" ] ; then \ + changelog --debug=$(DEBUG) generate \ + --repo-path . \ + --changelog-paths $(VERSION)/kong,$(UNRELEASED_DIR)/kong \ + --title Kong \ + --github-issue-repo $(OWNER_REPO) \ + --github-api-repo $(OWNER_REPO) \ + --with-jiras \ + >> $(VERSION).md; \ fi - @if [ -d "$(UNRELEASED_DIR)/kong-manager" ] && [ -n "$$(shopt -s nullglob; echo $(UNRELEASED_DIR)/kong-manager/*.yml)" ] ; then \ - if [ -f "$(VERSION)/$(VERSION).md" ]; then \ - changelog --debug=$(DEBUG) generate \ - --repo-path . \ - --changelog-paths $(VERSION)/kong-manager,$(UNRELEASED_DIR)/kong-manager \ - --title Kong-Manager \ - --github-issue-repo Kong/kong-manager \ - --github-api-repo $(OWNER_REPO) \ - --with-jiras \ - >> $(VERSION).md; \ - else \ - changelog --debug=$(DEBUG) generate \ - --repo-path . \ - --changelog-paths $(UNRELEASED_DIR)/kong-manager \ - --title Kong-Manager \ - --github-issue-repo Kong/kong-manager \ - --github-api-repo $(OWNER_REPO) \ - --with-jiras \ - >> $(VERSION).md; \ - fi \ + @if [ -n "$$(shopt -s nullglob; echo $(UNRELEASED_DIR)/kong-manager/*.yml)" ] || \ + [ -n "$$(shopt -s nullglob; echo $(VERSION)/kong-manager/*.yml)" ] ; then \ + changelog --debug=$(DEBUG) generate \ + --repo-path . \ + --changelog-paths $(VERSION)/kong-manager,$(UNRELEASED_DIR)/kong-manager \ + --title Kong-Manager \ + --github-issue-repo Kong/kong-manager \ + --github-api-repo $(OWNER_REPO) \ + --with-jiras \ + >> $(VERSION).md; \ fi @echo