Skip to content

Commit

Permalink
fix: CHANGELOG sorting and generation
Browse files Browse the repository at this point in the history
The CHANGELOG.md is now sorted in semver order, i.e. v0.24.2 will be
sorted before v0.25.0 and not before v0.27.1 as before. This fixes
cherry-picks and is more intuitive for the reader. Also, only
semver-compliant tags are included. This is to work around a bug in
git-chlog and also drop any non-semver compliant tags from the log

Closes: #2638 #2655
Signed-off-by: Michael Gasch <mgasch@vmware.com>
  • Loading branch information
Michael Gasch committed Nov 11, 2021
1 parent 7f4c8e0 commit 10fec66
Show file tree
Hide file tree
Showing 3 changed files with 396 additions and 286 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/govmomi-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
run: |
# use a pseudo tag to only include changes since last release
NEXT_TAG=$(git describe --abbrev=0 --tags)-next
docker run --rm -v $PWD:/workdir ${IMAGE}@sha256:${IMAGE_SHA} --next-tag ${NEXT_TAG} -o RELEASE_CHANGELOG.md ${NEXT_TAG}
docker run --rm -v $PWD:/workdir ${IMAGE}@sha256:${IMAGE_SHA} --next-tag ${NEXT_TAG} -o RELEASE_CHANGELOG.md --sort semver --tag-filter-pattern '^v[0-9]+' ${NEXT_TAG}
- name: Archive CHANGELOG
uses: actions/upload-artifact@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/govmomi-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
IMAGE_SHA: 998e89dab8dd8284cfff5f8cfb9e9af41fe3fcd4671f2e86a180e453c20959e3
run: |
# generate CHANGELOG for this Github release tag only
docker run --rm -v $PWD:/workdir ${IMAGE}@sha256:${IMAGE_SHA} -o RELEASE_CHANGELOG.md $(basename "${{ github.ref }}" )
docker run --rm -v $PWD:/workdir ${IMAGE}@sha256:${IMAGE_SHA} -o RELEASE_CHANGELOG.md --sort semver --tag-filter-pattern '^v[0-9]+' $(basename "${{ github.ref }}" )
- name: Archive CHANGELOG
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -80,8 +80,8 @@ jobs:
# https://quay.io/repository/git-chglog/git-chglog from tag v0.14.2
IMAGE_SHA: 998e89dab8dd8284cfff5f8cfb9e9af41fe3fcd4671f2e86a180e453c20959e3
run: |
# generate CHANGELOG for this Github release tag only
docker run --rm -v $PWD:/workdir ${IMAGE}@sha256:${IMAGE_SHA} -o CHANGELOG.md -t .chglog/CHANGELOG.tpl.md v0.1.0..$(basename "${{ github.ref }}" )
# update CHANGELOG
docker run --rm -v $PWD:/workdir ${IMAGE}@sha256:${IMAGE_SHA} -o CHANGELOG.md --sort semver --tag-filter-pattern '^v[0-9]+' -t .chglog/CHANGELOG.tpl.md
- name: Create Pull Request
id: cpr
Expand Down
Loading

0 comments on commit 10fec66

Please sign in to comment.