Skip to content

Commit

Permalink
build(release): add reno tools to build image and makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
hairyhum committed Mar 15, 2024
1 parent 9dfd130 commit 1bf1538
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ release-helm:
@/bin/bash ./build/release_helm.sh $(VERSION)

gorelease:
@$(MAKE) run CMD="./build/gorelease.sh"
@$(MAKE) run CMD="./build/gorelease.sh $(CHANGELOG_FILE)"

release-snapshot:
@$(MAKE) run CMD="GORELEASER_CURRENT_TAG=v9.99.9-dev goreleaser --debug release --rm-dist --snapshot --timeout=60m0s"
Expand Down Expand Up @@ -284,3 +284,8 @@ uninstall-crds: ## Uninstall CRDs from the K8s cluster specified in ~/.kube/conf
manifests: ## Generates CustomResourceDefinition objects.
@$(MAKE) run CMD="./build/generate_crds.sh ${CONTROLLER_TOOLS_VERSION}"

reno-new:
@$(MAKE) run CMD="reno new $(note)"

reno-report:
@$(MAKE) run CMD="reno report > ./CHANGELOG.md"
9 changes: 8 additions & 1 deletion build/gorelease.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,11 @@ then
echo "You can generate a token here: https://github.com/settings/tokens/new"
exit 1
fi
goreleaser release --parallelism=1 --rm-dist --debug --timeout 120m

RELEASE_NOTES=""
if [ -n "${CHANGELOG_FILE:-}" ]
then
RELEASE_NOTES="--release-notes ${CHANGELOG_FILE}"
fi

goreleaser release --parallelism=1 --rm-dist --debug --timeout 120m ${RELEASE_NOTES}
4 changes: 4 additions & 0 deletions docker/build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ RUN git config --global --add safe.directory /go/src/github.com/kanisterio/kanis
# Adding CRD documentation generation tool.
RUN GOBIN=/usr/local/bin go install github.com/ahmetb/gen-crd-api-reference-docs@v0.3.0

RUN apt-get update && apt-get install -y pip

RUN pip install reno

ENV CGO_ENABLED=0 \
GO111MODULE="on" \
GOROOT="/usr/local/go" \
Expand Down
39 changes: 39 additions & 0 deletions releasenotes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## Release notes

Release notes use [https://docs.openstack.org/reno/latest/](reno)

Release notes are stored in `releasenotes/notes` directory.

Reno allows to generate release notes using files in the repository as opposed to generating from commit messages.
This makes it easier to review and edit release notes.

## Development flow

When submitting a PR with some changes worthy of mentioning in the notes (new feature, bugfix, deprecation, update requirements),
committer should add a new note file using `reno new <note_name>` or `make reno-new note=<note_name>`.

New file will be created in `releasenotes/notes` directory with default template.
Change notes should be added to this file to reflect the change and additional information such as deprecations or upgrade requirements.
It's recommended to remove unused template fields.

When reviewing a PR, a reviewer should check if there are change notes added if necessary and either request or add a new note if they have push access to the branch

## Generating changelogs

Changelog can be generated using:

```
reno report ./ > CHANGELOG.md
```
OR
```
make reno-report
```

This will create a CHANGELOG.md file with changes from committed release notes.

It can later be passed to goreleaser build as `CHANGELOG_FILE` variable:

```
make gorelease CHANGELOG_FILE=./CHANGELOG.md
```
27 changes: 27 additions & 0 deletions releasenotes/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
collapse_pre_releases: false
earliest_version: 0.104.0
add_release_date: false
stop_at_branch_base: true
ignore_notes: []

sections:
- [features, New Features]
- [fixes, Bug Fixes]
- [security, Security Issues]
- [issues, Known Issues]
- [upgrade, Upgrade Notes]
- [deprecations, Deprecations]
- [other, Other Notes]

prelude_section_name: release_summary
template: |
---
release_summary:
features:
issues:
upgrade:
deprecations:
security:
fixes:
other:

0 comments on commit 1bf1538

Please sign in to comment.