Skip to content

Commit

Permalink
DOCS: Add the changelog feature (#5612)
Browse files Browse the repository at this point in the history
Co-authored-by: Samuel Lopez <[email protected]>
Co-authored-by: Sébastien Morais <[email protected]>
Co-authored-by: Sebastien Morais <[email protected]>
Co-authored-by: pyansys-ci-bot <[email protected]>
  • Loading branch information
5 people authored Mar 7, 2025
1 parent 4d786bf commit 69c73af
Show file tree
Hide file tree
Showing 11 changed files with 140 additions and 7 deletions.
5 changes: 0 additions & 5 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,3 @@ testing:
- "tests/system/conftest.py"
- "tests/system/solvers/conftest.py"
- "tests/system/general/conftest.py"

examples:
- changed-files:
- any-glob-to-any-file:
- "examples/**/*"
4 changes: 4 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@
- name: examples
description: Anything related to the examples
color: 3C2E5F

- name: security
description: Anything related to security advisories
color: FF0000
16 changes: 16 additions & 0 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ concurrency:

jobs:

update-changelog:
name: "Update CHANGELOG (on release)"
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: ansys/actions/doc-deploy-changelog@v8
with:
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}

pr-title:
if: github.event_name == 'pull_request'
name: Check the title of the pull request
Expand All @@ -39,6 +53,7 @@ jobs:
doc-style:
name: Documentation style check
runs-on: ubuntu-latest
needs: [pr-title]
steps:
- name: Check documentation style
uses: ansys/actions/doc-style@v8
Expand All @@ -62,6 +77,7 @@ jobs:
smoke-tests:
name: Build wheelhouse and smoke tests
runs-on: ${{ matrix.os }}
needs: [pr-title]
strategy:
fail-fast: false
matrix:
Expand Down
24 changes: 22 additions & 2 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Labeler

on:
pull_request:
# opened, reopened, and synchronize are default for pull_request
# edited - when PR title or body is changed
# labeled - when labels are added to PR
types: [opened, reopened, synchronize, edited, labeled]
push:
branches: [ main ]
paths:
Expand Down Expand Up @@ -55,8 +60,7 @@ jobs:
- uses: actions-ecosystem/action-add-labels@v1
if: startsWith(github.event.pull_request.head.ref, 'feat')
with:
labels: |
enhancement
labels: enhancement

- uses: actions-ecosystem/action-add-labels@v1
if: |
Expand Down Expand Up @@ -89,3 +93,19 @@ jobs:
- [maintenance](https://github.com/ansys/pyaedt/pulls?q=label%3Amaintenance+)
- [release](https://github.com/ansys/pyaedt/pulls?q=label%3Arelease+)
- [testing](https://github.com/ansys/pyaedt/pulls?q=label%Atesting+)
changelog-fragment:
name: "Create changelog fragment"
needs: [labeler]
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: ansys/actions/doc-changelog@v8
with:
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
use-conventional-commits: true
use-default-towncrier-config: true
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# CHANGELOG

This project uses [towncrier](https://towncrier.readthedocs.io/) to generate changelogs.

Refer to the [raw release notes](doc/source/changelog.rst) for more information.

[Published release notes](https://aedt.docs.pyansys.com/version/stable/changelog.html) can be found in the online documentation.
1 change: 1 addition & 0 deletions doc/changelog.d/5612.documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add the changelog feature
19 changes: 19 additions & 0 deletions doc/changelog.d/changelog_template.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{% if sections[""] %}

.. tab-set::
{%+ for category, val in definitions.items() if category in sections[""] +%}
.. tab-item:: {{ definitions[category]['name'] }}

.. list-table::
:header-rows: 0
:widths: auto

{%+ for text, values in sections[""][category].items() +%}
* - {{ text }}
- {{ values|join(', ') }}
{% endfor %}
{% endfor %}

{% else %}
No significant changes.
{% endif %}
14 changes: 14 additions & 0 deletions doc/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. _ref_release_notes:

Release notes
#############

This document contains the release notes for the project.

.. vale off
.. towncrier release notes start
.. vale on
11 changes: 11 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,3 +330,14 @@ def setup(app):
# Change the preamble of latex with customized title page
# variables are the title of pdf, watermark
latex_elements = {"preamble": latex.generate_preamble(html_title)}

linkcheck_ignore = [
r"https://download.ansys.com/",
]

# If we are on a release, we have to ignore the "release" URLs, since it is not
# available until the release is published.
if switcher_version != "dev":
linkcheck_ignore.append(
f"https://github.com/ansys/pyaedt/releases/tag/v{__version__}"
) # noqa: E501
1 change: 1 addition & 0 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ enabling straightforward and efficient automation in your workflow.
User_guide/index
API/index
Examples <https://examples.aedt.docs.pyansys.com/>
changelog
45 changes: 45 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,48 @@ exclude = [
'\.tests', # missing docstring for tests
'HistoryProps.', # bad RT05 because of the base class named OrderedDict
]

[tool.towncrier]
package = "ansys.aedt.core"
directory = "doc/changelog.d"
filename = "CHANGELOG.md"
start_string = "<!-- towncrier release notes start -->\n"
underlines = ["", "", ""]
template = "doc/changelog.d/changelog_template.jinja"
title_format = "## [{version}](https://github.com/ansys/pyaedt/releases/tag/v{version}) - {project_date}"
issue_format = "[#{issue}](https://github.com/ansys/pyaedt/pull/{issue})"

[[tool.towncrier.type]]
directory = "added"
name = "Added"
showcontent = true

[[tool.towncrier.type]]
directory = "dependencies"
name = "Dependencies"
showcontent = true

[[tool.towncrier.type]]
directory = "documentation"
name = "Documentation"
showcontent = true

[[tool.towncrier.type]]
directory = "fixed"
name = "Fixed"
showcontent = true

[[tool.towncrier.type]]
directory = "maintenance"
name = "Maintenance"
showcontent = true

[[tool.towncrier.type]]
directory = "miscellaneous"
name = "Miscellaneous"
showcontent = true

[[tool.towncrier.type]]
directory = "test"
name = "Test"
showcontent = true

0 comments on commit 69c73af

Please sign in to comment.