From 0a7af23bd77dd6f04ce27687bb75a8dfb226c6ae Mon Sep 17 00:00:00 2001 From: manuroe Date: Mon, 9 Aug 2021 15:57:14 +0200 Subject: [PATCH] CHANGES.md: Use towncrier to manage the change log vector-im/element-ios#4393 More info in [CONTRIBUTING](CONTRIBUTING.md#changelog) --- .github/PULL_REQUEST_TEMPLATE.md | 4 +-- CONTRIBUTING.md | 2 +- changelog.d/.gitignore | 1 + changelog.d/4393.build | 1 + changelog.d/_template.md.jinja | 52 ++++++++++++++++++++++++++++++++ towncrier.toml | 45 +++++++++++++++++++++++++++ 6 files changed, 102 insertions(+), 3 deletions(-) create mode 100644 changelog.d/.gitignore create mode 100644 changelog.d/4393.build create mode 100644 changelog.d/_template.md.jinja create mode 100644 towncrier.toml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 0140524ea..a36311fbc 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -3,6 +3,6 @@ * [ ] I read the [contributing guide](https://github.com/vector-im/element-ios/blob/develop/CONTRIBUTING.md) * [ ] UI change has been tested on both light and dark themes, in portrait and landscape orientations and on iPhone and iPad simulators * [ ] Pull request is based on the develop branch -* [ ] Pull request updates [CHANGES.rst](https://github.com/vector-im/riot-ios/blob/develop/CHANGES.rst) +* [ ] Pull request contains a changelog file in ./changelog.d. See * [ ] Pull request includes screenshots or videos of UI changes -* [ ] Pull request includes a [sign off](https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.md#sign-off) +* [ ] Pull request includes a [sign off](https://github.com/matrix-org/matrix-ios-sdk/blob/develop/CONTRIBUTING.md#sign-off) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cc28bc49d..17281c521 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing code to Matrix -Please read Synapse [contributing guide](https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.md). +Please read the matrix-ios-sdk [contributing guide](https://github.com/matrix-org/matrix-ios-sdk/blob/develop/CONTRIBUTING.md). # Contributing code to Element iOS diff --git a/changelog.d/.gitignore b/changelog.d/.gitignore new file mode 100644 index 000000000..f935021a8 --- /dev/null +++ b/changelog.d/.gitignore @@ -0,0 +1 @@ +!.gitignore diff --git a/changelog.d/4393.build b/changelog.d/4393.build new file mode 100644 index 000000000..d24a7e191 --- /dev/null +++ b/changelog.d/4393.build @@ -0,0 +1 @@ +CHANGES.md: Use towncrier to manage the change log. More info in [CONTRIBUTING](CONTRIBUTING.md#changelog). \ No newline at end of file diff --git a/changelog.d/_template.md.jinja b/changelog.d/_template.md.jinja new file mode 100644 index 000000000..2a7b9d6fe --- /dev/null +++ b/changelog.d/_template.md.jinja @@ -0,0 +1,52 @@ +{# iOS Repositories #} +{%- set gh_sdk = "https://github.com/matrix-org/matrix-ios-sdk" -%} +{%- set gh_kit = "https://github.com/matrix-org/matrix-ios-kit" -%} +{%- set gh_element = "https://github.com/vector-im/element-ios" -%} + +## {{ versiondata.name }} {{ versiondata.version }} ({{ versiondata.date }}) +{% for section, _ in sections.items() %} + +{% if sections[section] %} +{% for category, val in definitions.items() if category in sections[section]%} +{{ definitions[category]['name'] }} + +{% if definitions[category]['showcontent'] %} +{% for text, values in sections[section][category].items() %} +{# Build all types of links we can have from our different repositories #} +{%- set links = [] -%} +{%- for value in values %} + {%- if value.startswith("sdk-") %} + {%- set gh_issue = value.replace("sdk-", "") -%} + {{- links.append( "[#%s](%s/issues/%s)" | format(gh_issue, gh_sdk, gh_issue) ) | default("", True) -}} + {%- elif value.startswith("kit-") %} + {%- set gh_issue = value.replace("kit-", "") -%} + {{- links.append( "[#%s](%s/issues/%s)" | format(gh_issue, gh_kit, gh_issue) ) | default("", True) -}} + {%- elif value.startswith("#") %} + {%- set gh_issue = value.replace("#", "") -%} + {{- links.append( "[#%s](%s/issues/%s)" | format(gh_issue, gh_element, gh_issue) ) | default("", True) -}} + {%- elif value.startswith("pr-") %} + {%- set pr = value.replace("pr-", "#") -%} + {{- links.append(pr) | default("", True) -}} + {% else %} + {{- links.append(value) | default("", True) -}} + {% endif -%} +{% endfor -%} +- {{ text }} ({{ links | 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 %} \ No newline at end of file diff --git a/towncrier.toml b/towncrier.toml new file mode 100644 index 000000000..2587d18b2 --- /dev/null +++ b/towncrier.toml @@ -0,0 +1,45 @@ +[tool.towncrier] +name = "Changes in" +filename = "CHANGES.md" +directory = "changelog.d" +template = "changelog.d/_template.md.jinja" + +[[tool.towncrier.type]] + directory = "feature" + name = "✨ Features" + showcontent = true + +[[tool.towncrier.type]] + directory = "change" + name = "🙌 Improvements" + showcontent = true + +[[tool.towncrier.type]] + directory = "bugfix" + name = "🐛 Bugfixes" + showcontent = true + +[[tool.towncrier.type]] + directory = "api" + name = "⚠️ API Changes" + showcontent = true + +[[tool.towncrier.type]] + directory = "i18n" + name = "🗣 Translations" + showcontent = true + +[[tool.towncrier.type]] + directory = "build" + name = "🧱 Build" + showcontent = true + +[[tool.towncrier.type]] + directory = "doc" + name = "📄 Documentation" + showcontent = true + +[[tool.towncrier.type]] + directory = "misc" + name = "Others" + showcontent = true