Skip to content

Commit

Permalink
feat: changelog actions (#613)
Browse files Browse the repository at this point in the history
Co-authored-by: Mohamed Koubaa <[email protected]>
Co-authored-by: Mohamed Koubaa <[email protected]>
Co-authored-by: Revathy Venugopal <[email protected]>
Co-authored-by: Kerry McAdams <[email protected]>
Co-authored-by: pyansys-ci-bot <[email protected]>
  • Loading branch information
6 people authored Nov 15, 2024
1 parent 8cc3047 commit 73832f0
Show file tree
Hide file tree
Showing 9 changed files with 131 additions and 4 deletions.
28 changes: 27 additions & 1 deletion .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,34 @@ 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-name:
if: github.event_name == 'pull_request'
name: Check the name of the PR
runs-on: ubuntu-latest
steps:
- name: Check commit name
uses: ansys/actions/check-pr-title@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}

code-style:
name: "Code style"
runs-on: ubuntu-latest
needs: pr-name
steps:
- uses: ansys/actions/code-style@v8
with:
Expand Down Expand Up @@ -67,6 +92,7 @@ jobs:
doc-style:
name: "Documentation style"
runs-on: ubuntu-latest
needs: pr-name
steps:
- name: PyAnsys documentation style checks
uses: ansys/actions/doc-style@v8
Expand Down Expand Up @@ -288,7 +314,7 @@ jobs:
release:
name: Release project
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
needs: [build-library]
needs: [update-changelog, build-library]
runs-on: ubuntu-latest
steps:
- name: "Release to the public PyPI repository"
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,18 @@ jobs:
- [maintenance](https://github.com/pyansys/pyDyna/pulls?q=label%3Amaintenance+)
- [release](https://github.com/pyansys/pyDyna/pulls?q=label%3Arelease+)
- [testing](https://github.com/pyansys/pyDyna/pulls?q=label%Atesting+)
changelog-fragment:
name: "Create changelog fragment"
needs: [commenter]
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: ansys/actions/doc-changelog@v8
with:
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}

3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This project uses [towncrier](https://towncrier.readthedocs.io/). Changes for
the upcoming release can be found in
[doc/source/changelog.rst](doc/source/changelog.rst).
1 change: 1 addition & 0 deletions doc/changelog/613.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
feat: changelog actions
17 changes: 17 additions & 0 deletions doc/changelog/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% if sections[""] %}
{% for category, val in definitions.items() if category in sections[""] %}

{{ definitions[category]['name'] }}
{% set underline = '^' * definitions[category]['name']|length %}
{{ underline }}

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

{% endfor %}
{% else %}
No significant changes.


{% endif %}
10 changes: 10 additions & 0 deletions doc/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Release notes
#############

This document contains the release notes for the PyDyna project.

.. vale off
.. towncrier release notes start
.. vale on
1 change: 1 addition & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
# Read link all targets from file
with open("links.rst") as f:
rst_epilog += f.read()
linkcheck_exclude_documents = ["changelog"]

inheritance_graph_attrs = dict(rankdir="RL", size='"8.0, 10.0"', fontsize=14, ratio="compress")
inheritance_node_attrs = dict(shape="ellipse", fontsize=14, height=0.75, color="dodgerblue1", style="filled")
Expand Down
1 change: 1 addition & 0 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ PyDYNA documentation |version|
examples/index
{% endif %}
contributing
changelog
59 changes: 56 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"

[project]
name = "ansys-dyna-core"
version = "0.4.dev0"
version = "0.6.dev0"
description = "Python interface to LS-DYNA Service"
readme = "README.rst"
requires-python = ">=3.10,<4"
Expand Down Expand Up @@ -83,10 +83,10 @@ doc = [
name = "ansys.dyna.core"

[project.urls]
Source = "https://github.com/pyansys/pydyna"
Source = "https://github.com/ansys/pydyna"
Homepage = "https://dyna.docs.pyansys.com"
Documentation = "https://dyna.docs.pyansys.com"
Tracker = "https://github.com/pyansys/pydyna/issues"
Tracker = "https://github.com/ansys/pydyna/issues"

[tool.black]
line-length = 120
Expand All @@ -108,3 +108,56 @@ show_missing = true
minversion = "7.1"
addopts = "-ra --cov=ansys.dyna.core --cov-report html:.cov/html --cov-report xml:.cov/xml --cov-report term -vv"
testpaths = ["tests"]

[tool.towncrier]
directory = "doc/changelog"
filename = "doc/source/changelog.rst"
template = "doc/changelog/template"
start_string = ".. towncrier release notes start\n"
title_format = "`{version} <https://github.com/ansys/pydyna/releases/tag/v{version}>`_ - {project_date}"
issue_format = "`#{issue} <https://github.com/ansys/pydyna/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 = "documentation"
name = "Documentation"
showcontent = true

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

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

0 comments on commit 73832f0

Please sign in to comment.