Setup release notes build using towncrier tool

This commit is contained in:
Povilas Kanapickas 2021-11-01 21:31:00 +02:00
parent e8453f2b9a
commit e7bdcb5249
4 changed files with 90 additions and 9 deletions

View File

@ -1,12 +1,13 @@
This is the directory for news snippets used by towncrier: https://github.com/twisted/towncrier
This is the directory for release note fragments processed by
[towncrier](https://github.com/hawkowl/towncrier).
When changing code in a way that's visible to an end user please make a new file in this directory.
It will be removed and integrated into release notes document upon a release of a new version of
Barrier.
When making a user-visible change create a file in this directory and it will be automatically be
included into the release note document when the next release is published.
towncrier has a few standard types of news fragments, signified by the file extension. These are:
The file extension specifies the type of a change. The following are currently supported:
.feature: Signifying a new feature.
.bugfix: Signifying a bug fix.
.doc: Signifying a documentation improvement.
.removal: Signifying a deprecation or removal of public API.
- .feature: a new feature.
- .bugfix: a bug fix.
- .security: a fix for security issue.
- .doc: a documentation improvement.
- .removal: a deprecation or removal of functionality.

View File

@ -0,0 +1,4 @@
Release notes
=============
[comment]: <> (towncrier release notes start)

View File

@ -0,0 +1,37 @@
{% for section, _ in sections|dictsort(by='key') %}
{% set underline = "-" %}
{% if section %}
{{section}}
{{ underline * section|length }}{% set underline = "-" %}
{% endif %}
{% if sections[section] %}
{% for category, val in definitions|dictsort if category in sections[section]%}
{{ definitions[category]['name'] }}
{{ underline * definitions[category]['name']|length }}
{% if definitions[category]['showcontent'] %}
{% for text, values in sections[section][category]|dictsort(by='value') %}
- {{ text }}
{% endfor %}
{% else %}
- {{ sections[section][category]['']|sort|join(', ') }}
{% endif %}
{% if sections[section][category]|length == 0 %}
No significant changes.
{% else %}
{% endif %}
{% endfor %}
{% else %}
No significant changes.
{% endif %}
{% endfor %}

39
towncrier.toml Normal file
View File

@ -0,0 +1,39 @@
[tool.towncrier]
package = ""
directory = "doc/newsfragments"
filename = "doc/release_notes/index.md"
template = "doc/release_notes/index.template.jinja"
title_format = "\nBarrier `{version}` ( `{project_date}` )\n================================\n"
start_string = "[comment]: <> (towncrier release notes start)"
[[tool.towncrier.section]]
path = ""
[[tool.towncrier.type]]
directory = "security"
name = "Security fixes"
showcontent = false
[[tool.towncrier.type]]
directory = "feature"
name = "Features"
showcontent = true
[[tool.towncrier.type]]
directory = "bugfix"
name = "Bug fixes"
showcontent = true
[[tool.towncrier.type]]
directory = "doc"
name = "Improved Documentation"
showcontent = true
[[tool.towncrier.type]]
directory = "removal"
name = "Deprecations and Removals"
showcontent = true
[[tool.towncrier.type]]
directory = "misc"
name = "Miscellaneous"
showcontent = false