Skip to content

Commit

Permalink
WIP: support continuous report generation
Browse files Browse the repository at this point in the history
  • Loading branch information
hairyhum committed Mar 28, 2024
1 parent 1bf1538 commit 77756a1
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
/dist
**/*.swp
/.idea
/releasenotes/config.yaml
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -288,4 +288,4 @@ reno-new:
@$(MAKE) run CMD="reno new $(note)"

reno-report:
@$(MAKE) run CMD="reno report > ./CHANGELOG.md"
@$(MAKE) run CMD="./build/reno_report.sh $(VERSION)"
14 changes: 14 additions & 0 deletions build/reno_report.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

version=${1:-"''"}

## Latest notes should go to current version
## We generate report before tagging the repo, so we need to set this version here
# echo "unreleased_version_title: ${version}" > reno.yaml
sed "s/unreleased_version_title: ''/unreleased_version_title: ${version}/g" reno.yaml > releasenotes/config.yaml

## Generate rst report
reno report --output ./CHANGELOG.rst

## Convert rst to markdown
rst2md ./CHANGELOG.rst --output ./CHANGELOG.md
2 changes: 1 addition & 1 deletion build/run_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ set -o nounset
PWD="${PWD:-$(pwd)}"

DOCS_BUILD_IMAGE="${DOCS_BUILD_IMAGE:-ghcr.io/kanisterio/docker-sphinx:0.2.0}"
BUILD_IMAGE="${BUILD_IMAGE:-ghcr.io/kanisterio/build:v0.0.28}"
BUILD_IMAGE="${BUILD_IMAGE:-ghcr.io/kanisterio/build:v0.0.28-reno}"
PKG="${PKG:-github.com/kanisterio/kanister}"

ARCH="${ARCH:-amd64}"
Expand Down
7 changes: 4 additions & 3 deletions releasenotes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ When reviewing a PR, a reviewer should check if there are change notes added if
Changelog can be generated using:

```
reno report ./ > CHANGELOG.md
make reno-report
```
OR
or to mark specific current version:
```
make reno-report
make reno-report VERSION=$CURRENT_VERSION
```

This will create a CHANGELOG.md file with changes from committed release notes.
Expand All @@ -37,3 +37,4 @@ It can later be passed to goreleaser build as `CHANGELOG_FILE` variable:
```
make gorelease CHANGELOG_FILE=./CHANGELOG.md
```

2 changes: 2 additions & 0 deletions releasenotes/config.yaml → reno.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ sections:
- [deprecations, Deprecations]
- [other, Other Notes]

unreleased_version_title: ''

prelude_section_name: release_summary
template: |
---
Expand Down

0 comments on commit 77756a1

Please sign in to comment.