From 4535b9f41c310b3d590e2e0d8e3758d0d39d5105 Mon Sep 17 00:00:00 2001 From: ldelossa Date: Fri, 16 Apr 2021 16:56:29 -0400 Subject: [PATCH] cicd: changelog fixups swaps out my fork for the latest git-chglog tool with semver sorting. in addition this pr performs the correct semver filtering for release branch changelogs. Signed-off-by: ldelossa --- .chglog/config.yml | 2 +- .github/workflows/cut-release.yml | 4 +++- .github/workflows/prepare-release.yml | 19 +++++++++++++++++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.chglog/config.yml b/.chglog/config.yml index c55faf7128..e643b95091 100644 --- a/.chglog/config.yml +++ b/.chglog/config.yml @@ -4,7 +4,7 @@ info: title: CHANGELOG repository_url: https://github.com/quay/clair options: - tag_sort_by: semver + sort: semver commits: sort_by: Scope commit_groups: diff --git a/.github/workflows/cut-release.yml b/.github/workflows/cut-release.yml index 407a623e96..b834e11a37 100644 --- a/.github/workflows/cut-release.yml +++ b/.github/workflows/cut-release.yml @@ -35,7 +35,9 @@ jobs: touch changelog exit 0 fi - curl -o /tmp/git-chglog -L https://github.com/ldelossa/git-chglog/releases/download/v0.11.2-sortbysemver/linux.amd64.git-chglog + curl -o /tmp/git-chglog.tar.gz -fsSL\ + https://github.com/git-chglog/git-chglog/releases/download/v0.14.0/git-chglog_0.14.0_linux_amd64.tar.gz + tar xvf /tmp/git-chglog.tar.gz --directory /tmp chmod u+x /tmp/git-chglog echo "creating change log for tag: $TAG" /tmp/git-chglog "${TAG}" > changelog diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 85791ee93b..cbdbe198be 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -25,10 +25,25 @@ jobs: - name: Changelog shell: bash run: | - curl -o /tmp/git-chglog -L https://github.com/ldelossa/git-chglog/releases/download/v0.11.2-sortbysemver/linux.amd64.git-chglog + curl -o /tmp/git-chglog.tar.gz -fsSL\ + https://github.com/git-chglog/git-chglog/releases/download/v0.14.0/git-chglog_0.14.0_linux_amd64.tar.gz + tar xvf /tmp/git-chglog.tar.gz --directory /tmp chmod u+x /tmp/git-chglog echo "creating change log for tag: ${{ github.event.inputs.tag }}" - /tmp/git-chglog --tag-filter-pattern "v4" --next-tag "${{ github.event.inputs.tag }}" -o CHANGELOG.md v4.0.0-alpha.2.. + + # if this is a release branch filter our change + # log to only include logs with the same minor + # versions + # otherwise just filter v4 for full v4 history + # on main branch + filter_tag="--tag-filter-pattern v4" + branch=${{ github.event.inputs.branch }} + echo "discovered branch $branch" + if [[ ${branch%-*} == "release" ]]; then + filter_tag="--tag-filter-pattern v${branch#release-}" + fi + + /tmp/git-chglog $filter_tag --next-tag "${{ github.event.inputs.tag }}" -o CHANGELOG.md v4.0.0-alpha.2.. - name: Create Pull Request uses: peter-evans/create-pull-request@v3.5.1 with: