diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4044b5b7..b7331402 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,8 +12,10 @@ updates: - package-ecosystem: "github-actions" directory: "/" schedule: - interval: "daily" + interval: "weekly" labels: - "maintenance" + assignees: + - "pyansys-ci-bot" commit-message: - prefix: "maint" + prefix: "ci" diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 5ee9950b..385956c5 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -11,7 +11,6 @@ on: env: MAIN_PYTHON_VERSION : '3.10' PACKAGE_NAME: 'ansys-sphinx-theme' - PACKAGE_NAMESPACE: 'ansys_sphinx_theme' DOCUMENTATION_CNAME: 'sphinxdocs.ansys.com' MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }} MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }} diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index 35ade524..9fb186e9 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -1,6 +1,10 @@ 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: @@ -80,3 +84,15 @@ jobs: - [good first issue](https://github.com/ansys/ansys-sphinx-theme/pulls?q=label%3Agood+first+issue) - [maintenance](https://github.com/ansys/ansys-sphinx-theme/pulls?q=label%3Amaintenance+) - [release](https://github.com/ansys/ansys-sphinx-theme/pulls?q=label%3Arelease+) + + changelog-fragment: + name: "Create changelog fragment" + needs: [labeler] + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: ansys/actions/doc-changelog@v6 + with: + token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} \ No newline at end of file diff --git a/doc/.vale.ini b/doc/.vale.ini index 617b6bea..a7d3e9a0 100644 --- a/doc/.vale.ini +++ b/doc/.vale.ini @@ -22,7 +22,7 @@ Packages = Google # Define the Ansys vocabulary Vocab = ANSYS -[*.{md,rst}] +[*.{rst}] # Apply the following styles BasedOnStyles = Vale, Google diff --git a/doc/changelog.d/370.added.md b/doc/changelog.d/370.added.md new file mode 100644 index 00000000..b50c5598 --- /dev/null +++ b/doc/changelog.d/370.added.md @@ -0,0 +1 @@ +feat: add the changelog action \ No newline at end of file diff --git a/doc/changelog.d/changelog_template.jinja b/doc/changelog.d/changelog_template.jinja new file mode 100644 index 00000000..b35bff39 --- /dev/null +++ b/doc/changelog.d/changelog_template.jinja @@ -0,0 +1,15 @@ +{% if sections[""] %} +{% for category, val in definitions.items() if category in sections[""] %} + +### {{ definitions[category]['name'] }} + +{% for text, values in sections[""][category].items() %} +- {{ text }} {{ values|join(', ') }} +{% endfor %} + +{% endfor %} +{% else %} +No significant changes. + + +{% endif %} \ No newline at end of file diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst new file mode 100644 index 00000000..cb1b8c0b --- /dev/null +++ b/doc/source/changelog.rst @@ -0,0 +1,13 @@ +.. _ref_release_notes: + +Release notes +############# + +This document contains the release notes for the project. + +.. vale off + +.. towncrier release notes start + + +.. vale on \ No newline at end of file diff --git a/doc/source/conf.py b/doc/source/conf.py index 55414ac5..e394c11f 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -27,6 +27,7 @@ author = "ANSYS, Inc." release = version = __version__ cname = os.getenv("DOCUMENTATION_CNAME", "sphinxdocs.ansys.com") +switcher_version = get_version_match(__version__) # use the default ansys logo html_logo = ansys_logo_black @@ -50,12 +51,6 @@ "additional_breadcrumbs": [ ("PyAnsys", "https://docs.pyansys.com/"), ], - "external_links": [ - { - "url": "https://github.com/ansys/ansys-sphinx-theme/releases", - "name": "Changelog", - }, - ], "switcher": { "json_url": f"https://{cname}/versions.json", "version_match": get_version_match(__version__), @@ -85,12 +80,7 @@ # Intersphinx mapping intersphinx_mapping = { "python": ("https://docs.python.org/3", None), - # kept here as an example - # "scipy": ("https://docs.scipy.org/doc/scipy/reference", None), - # "numpy": ("https://numpy.org/devdocs", None), - # "matplotlib": ("https://matplotlib.org/stable", None), - # "pandas": ("https://pandas.pydata.org/pandas-docs/stable", None), - # "pyvista": ("https://docs.pyvista.org/", None), + "sphinx": ("https://www.sphinx-doc.org/en/master", None), } # numpydoc configuration @@ -155,6 +145,12 @@ EXAMPLE_PATH = (THIS_PATH / "examples" / "sphinx_examples").resolve() +linkcheck_ignore = [] +if switcher_version != "dev": + linkcheck_ignore.append( + f"https://github.com/ansys/ansys-sphinx-theme/releases/tag/v{__version__}" + ) + def extract_example_links( repo_fullname: str, path_relative_to_root: str, exclude_files: List[str] diff --git a/doc/source/index.rst b/doc/source/index.rst index 93cac011..4cb56eca 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -11,3 +11,4 @@ Ansys Sphinx Theme documentation |version| getting_started/index.rst user_guide/index.rst examples/index.rst + changelog diff --git a/pyproject.toml b/pyproject.toml index 73e6c778..522bd894 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -83,3 +83,39 @@ source = ["src"] [tool.coverage.report] show_missing = true + + +[tool.towncrier] +directory = "doc/changelog.d" +filename = "doc/source/changelog.rst" +template = "doc/changelog.d/changelog_template.jinja" +start_string = ".. towncrier release notes start\n" +title_format = "`{version} `_ - {project_date}" +issue_format = "`#{issue} `_" + +[[tool.towncrier.type]] +directory = "added" +name = "Added" +showcontent = true + +[[tool.towncrier.type]] +directory = "changed" +name = "Changed" +showcontent = true + +[[tool.towncrier.type]] +directory = "fixed" +name = "Fixed" +showcontent = true + +[[tool.towncrier.type]] +directory = "dependencies" +name = "Dependencies" +showcontent = true + +[[tool.towncrier.type]] +directory = "miscellaneous" +name = "Miscellaneous" +showcontent = true + +