Merge pull request #3382 from vector-im/feature/bma/towncrier

Setup towncrier
This commit is contained in:
Benoit Marty 2021-05-21 14:35:40 +02:00 committed by GitHub
commit f7f80238f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 74 additions and 40 deletions

View File

@ -5,6 +5,6 @@
- [ ] Changes has been tested on an Android device or Android emulator with API 21
- [ ] UI change has been tested on both light and dark themes
- [ ] Pull request is based on the develop branch
- [ ] Pull request updates [CHANGES.md](https://github.com/vector-im/element-android/blob/develop/CHANGES.md)
- [ ] Pull request includes a new file under ./newsfragment. See https://github.com/vector-im/element-android/blob/develop/CONTRIBUTING.md#changelog
- [ ] Pull request includes screenshots or videos if containing UI changes
- [ ] Pull request includes a [sign off](https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.md#sign-off)

View File

@ -1379,36 +1379,3 @@ Changes in RiotX 0.1.0 (2019-07-11)
First release!
Mode details here: https://medium.com/@RiotChat/introducing-the-riotx-beta-for-android-b17952e8f771
=======================================================
+ TEMPLATE WHEN PREPARING A NEW RELEASE +
=======================================================
Changes in Element 1.1.X (2021-XX-XX)
===================================================
Features ✨:
-
Improvements 🙌:
-
Bugfix 🐛:
-
Translations 🗣:
-
SDK API changes ⚠️:
-
Build 🧱:
-
Test:
-
Other changes:
-

View File

@ -51,9 +51,21 @@ If an issue does not exist yet, it may be relevant to open a new issue and let u
This project is full Kotlin. Please do not write Java classes.
### CHANGES.md
### Changelog
Please add a line to the top of the file `CHANGES.md` describing your change.
Please create at least one file under ./newsfragment containing details about your change. Towncrier will be used when preparing the release.
Towncrier says to use the PR number for the filename, but the issue number is also fine.
Supported filename extensions are:
- ``.feature``: Signifying a new feature in Element Android or in the Matrix SDK.
- ``.bugfix``: Signifying a bug fix.
- ``.doc``: Signifying a documentation improvement.
- ``.removal``: Signifying a deprecation or removal of public API. Can be used to notifying about API change in the Matrix SDK
- ``.misc``: A ticket has been closed, but it is not of interest to users. Note that in this case, the content of the file will not be output, but just the issue/PR number.
See https://github.com/twisted/towncrier#news-fragments if you need more details.
### Code quality

1
newsfragment/3293.misc Normal file
View File

@ -0,0 +1 @@
Setup towncrier tool

View File

@ -0,0 +1,47 @@
{% if top_line %}
{{ top_line }}
{{ top_underline * ((top_line)|length)}}
{% elif versiondata.name %}
{{ versiondata.name }} {{ versiondata.version }} ({{ versiondata.date }})
{{ top_underline * ((versiondata.name + versiondata.version + versiondata.date)|length + 4)}}
{% else %}
{{ versiondata.version }} ({{ versiondata.date }})
{{ top_underline * ((versiondata.version + versiondata.date)|length + 3)}}
{% endif %}
{% for section, _ in sections.items() %}
{% set underline = underlines[0] %}{% if section %}{{section}}
{{ underline * section|length }}{% set underline = underlines[1] %}
{% endif %}
{% if sections[section] %}
{% for category, val in definitions.items() if category in sections[section]%}
{% if definitions[category]['name'] == "Features" %}
Features ✨:
{% elif definitions[category]['name'] == "Bugfixes" %}
Bugfixes 🐛:
{% elif definitions[category]['name'] == "Deprecations and Removals" %}
SDK API changes ⚠️:
{% elif definitions[category]['name'] == "Improved Documentation" %}
Improved Documentation 📚:
{% elif definitions[category]['name'] == "Misc" %}
Other changes:
{% else %}
{{ definitions[category]['name'] }}
{% endif %}
{% if definitions[category]['showcontent'] %}
{% for text, values in sections[section][category].items() %}
- {{ text }} ({{ values|join(', ') }})
{% endfor %}
{% else %}
- {{ sections[section][category]['']|join(', ') }}
{% endif %}
{% if sections[section][category]|length == 0 %}
No significant changes.
{% else %}
{% endif %}
{% endfor %}
{% else %}
No significant changes.
{% endif %}
{% endfor %}

View File

@ -23,7 +23,7 @@ branch=${TRAVIS_BRANCH}
# If not on develop, exit, else we cannot get the list of modified files
# It is ok to check only when on develop branch
if [[ "${branch}" -eq 'develop' ]]; then
echo "Check that the file 'CHANGES.md' has been modified"
echo "Check that a file has been added to /newsfragment"
else
echo "Not on develop branch"
exit 0
@ -37,9 +37,9 @@ listOfModifiedFiles=`git diff --name-only HEAD ${branch}`
# echo ${listOfModifiedFiles}
if [[ ${listOfModifiedFiles} = *"CHANGES.md"* ]]; then
echo "CHANGES.md has been modified!"
if [[ ${listOfModifiedFiles} = *"newsfragment"* ]]; then
echo "A file has been added to /newsfragment!"
else
echo "❌ Please add a line describing your change in CHANGES.md"
echo "❌ Please add a file describing your changes in /newsfragment. See https://github.com/vector-im/element-android/blob/develop/CONTRIBUTING.md#changelog"
exit 1
fi

7
towncrier.toml Normal file
View File

@ -0,0 +1,7 @@
[tool.towncrier]
directory = "newsfragment"
filename = "CHANGES.md"
name = "Changes in Element"
# Note: there is a bug, if I use title_format, the title is printed twice
# title_format = "Changes in Element {version} ({project_date})"
template="tools/towncrier/template.md"