Skip to content

Commit

Permalink
Merge pull request cytomining#356 from kenibrewer/docs/changelog-temp…
Browse files Browse the repository at this point in the history
…late

docs(changelog): add commitizen template
  • Loading branch information
kenibrewer authored Feb 13, 2024
2 parents 94a2ae7 + f3ed05c commit cfd0852
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
10 changes: 6 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,12 @@ 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](https://www.conventionalcommits.org/en/v1.0.0/#summary).
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`. If necessary, add descriptions of missing changes and modify descriptions to match conventional commits standard.
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 @@
{# Adapted from https://github.com/commitizen-tools/commitizen/blob/1d842b5d823a452109070f8af8857249e95f7713/commitizen/templates/CHANGELOG.md.j2 #}
{% for entry in tree %}

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

{# Add 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 cfd0852

Please sign in to comment.