diff --git a/.github/workflows/1_create_release_pr.yml b/.github/workflows/1_create_release_pr.yml index 9f537369f4d..f94b8d60873 100644 --- a/.github/workflows/1_create_release_pr.yml +++ b/.github/workflows/1_create_release_pr.yml @@ -43,15 +43,14 @@ jobs: init-file: 'cylc/flow/__init__.py' pypi-package-name: 'cylc-flow' - - name: Update "released on" date in changelog - continue-on-error: true - uses: cylc/release-actions/stage-1/update-changelog-release-date@v1 - with: - changelog-file: 'CHANGES.md' - - name: Test build uses: cylc/release-actions/build-python-package@v1 + - name: Generate changelog + run: | + python3 -m pip install -q towncrier + towncrier build --yes + - name: Create pull request uses: cylc/release-actions/stage-1/create-release-pr@v1 with: diff --git a/CHANGES.md b/CHANGES.md index 92020dc48c2..fd135ae9bcd 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,11 +4,12 @@ List of notable changes, for a complete list of changes see the [closed milestones](https://github.com/cylc/cylc-flow/milestones?state=closed) for each release. - + + + ## __cylc-8.2.0 (Upcoming)__ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 72f63d67d03..6fbc4283968 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,6 +36,11 @@ Feel free to ask questions on the issue or [developers chat](https://matrix.to/#/#cylc-general:matrix.org) if unsure about anything. +We use [towncrier](https://towncrier.readthedocs.io/en/stable/index.html) for +generating the changelog. Changelog entries are added by running +``` +towncrier create ..md --content "Short description" +``` ## Code Contributors diff --git a/changes.d/changelog-template.jinja b/changes.d/changelog-template.jinja new file mode 100644 index 00000000000..9a96512694c --- /dev/null +++ b/changes.d/changelog-template.jinja @@ -0,0 +1,13 @@ +{% if sections[""] %} +{% for category, val in definitions.items() if category in sections[""] %} +### {{ definitions[category]['name'] }} + +{% for text, pulls in sections[""][category].items() %} +{{ pulls|join(', ') }} - {{ text }} + +{% endfor %} +{% endfor %} +{% else %} +No significant changes. + +{% endif %} diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000000..6ceb7a1543a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,23 @@ +[tool.towncrier] +directory = "changes.d" +name = "Cylc" +package = "cylc.flow" +filename = "CHANGES.md" +template = "changes.d/changelog-template.jinja" +underlines = ["", "", ""] +title_format = "## __cylc-{version} (Released {project_date})__" +issue_format = "[#{issue}](https://github.com/cylc/cylc-flow/pull/{issue})" + +# These changelog sections will be shown in the defined order: +[[tool.towncrier.type]] +directory = "break" # NB this is just the filename not directory e.g. 123.break.md +name = "Breaking Changes" +showcontent = true +[[tool.towncrier.type]] +directory = "feat" +name = "Enhancements" +showcontent = true +[[tool.towncrier.type]] +directory = "fix" +name = "Fixes" +showcontent = true diff --git a/setup.cfg b/setup.cfg index cb5244a9509..eddfd22834e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -122,6 +122,7 @@ tests = pytest-mock>=3.6.1 pytest>=6 testfixtures>=6.11.0 + towncrier>=23 # Type annotation stubs # http://mypy-lang.blogspot.com/2021/05/the-upcoming-switch-to-modular-typeshed.html types-Jinja2>=0.1.3