Skip to content

Commit

Permalink
docs(changelog): add commitizen template
Browse files Browse the repository at this point in the history
This change adds a commitizen CHANGELOG template that includes a link to the detailed GitHub release notes.
  • Loading branch information
kenibrewer committed Nov 7, 2023
1 parent a8e6ca9 commit 84e4b08
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
9 changes: 5 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,11 @@ Project maintainers are responsible for releasing new versions of pycytominer.
Creating a new release includes the following steps:

1. Create a new branch from `main` for the release (e.g. `release-v1.0.0`)
2. Run the command `cz bump --files-only` to update the version number in `CITATION.cff` and `pyproject.toml:tool.commitizen`.
3. Review the changes to CHANGELOG.md and edit as needed.
4. Review the [commit history](https://github.com/cytomining/pycytominer/compare) from the last release and add documentation for changes that weren't auto-included because they didn't follow the conventional-commit standard.
5. `git add` all changes and run `cz bump` to create the release commit.
2. Review the [commit history](https://github.com/cytomining/pycytominer/compare) from the last release and check whether it includes commits that don't follow the conventional commit standard.
If all changes follow conventional commits, skip to step 5.
3. Run the command `cz bump --files-only` to update the version number in `CITATION.cff` and `pyproject.toml:tool.commitizen` and generate the draft changelog.
4. Review the changes to CHANGELOG.md and add descriptions of changes that didn't use conventional commit.
5. `git add` any manual changes and run `cz bump` to create the release commit. Push the changes to the release branch.
6. Create a pull request for the release branch into `main`.
7. Request a review from another maintainer.
8. Once the pull request is approved, merge it into `main`.
Expand Down
23 changes: 23 additions & 0 deletions dev_tools/commitizen/CHANGELOG.md.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{# Jinja2 changelog template used by Commitizen #}
{% for entry in tree %}

## {{ entry.version }}{% if entry.date %} ({{ entry.date }}){% endif %}

{# Sole difference from default template is link to the detailed GitHub release notes #}
[Detailed Release Notes](https://github.com/cytomining/pycytominer/releases/tag/{{ entry.version }})

{% for change_key, changes in entry.changes.items() %}

{% if change_key %}
### {{ change_key }}
{% endif %}

{% for change in changes %}
{% if change.scope %}
- **{{ change.scope }}**: {{ change.message }}
{% elif change.message %}
- {{ change.message }}
{% endif %}
{% endfor %}
{% endfor %}
{% endfor %}
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ tag_format = "v$version"
version_scheme = "pep440"
version_provider = "commitizen"
update_changelog_on_bump = true
template = "dev_tools/commitizen/CHANGELOG.md.j2"
version_files = [
"CITATION.cff"
]
Expand Down

0 comments on commit 84e4b08

Please sign in to comment.