Skip to content

Commit 73832f0

Browse files
jorgepilotokoubaaMohamed KoubaaRevathyvenugopal162klmcadams
authored
feat: changelog actions (#613)
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]>
1 parent 8cc3047 commit 73832f0

File tree

9 files changed

+131
-4
lines changed

9 files changed

+131
-4
lines changed

.github/workflows/ci_cd.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,34 @@ concurrency:
2626

2727
jobs:
2828

29+
update-changelog:
30+
name: "Update CHANGELOG (on release)"
31+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
32+
runs-on: ubuntu-latest
33+
permissions:
34+
contents: write
35+
pull-requests: write
36+
steps:
37+
- uses: ansys/actions/doc-deploy-changelog@v8
38+
with:
39+
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
40+
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
41+
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
42+
43+
pr-name:
44+
if: github.event_name == 'pull_request'
45+
name: Check the name of the PR
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Check commit name
49+
uses: ansys/actions/check-pr-title@v8
50+
with:
51+
token: ${{ secrets.GITHUB_TOKEN }}
52+
2953
code-style:
3054
name: "Code style"
3155
runs-on: ubuntu-latest
56+
needs: pr-name
3257
steps:
3358
- uses: ansys/actions/code-style@v8
3459
with:
@@ -67,6 +92,7 @@ jobs:
6792
doc-style:
6893
name: "Documentation style"
6994
runs-on: ubuntu-latest
95+
needs: pr-name
7096
steps:
7197
- name: PyAnsys documentation style checks
7298
uses: ansys/actions/doc-style@v8
@@ -288,7 +314,7 @@ jobs:
288314
release:
289315
name: Release project
290316
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
291-
needs: [build-library]
317+
needs: [update-changelog, build-library]
292318
runs-on: ubuntu-latest
293319
steps:
294320
- name: "Release to the public PyPI repository"

.github/workflows/label.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,18 @@ jobs:
8989
- [maintenance](https://github.com/pyansys/pyDyna/pulls?q=label%3Amaintenance+)
9090
- [release](https://github.com/pyansys/pyDyna/pulls?q=label%3Arelease+)
9191
- [testing](https://github.com/pyansys/pyDyna/pulls?q=label%Atesting+)
92+
93+
changelog-fragment:
94+
name: "Create changelog fragment"
95+
needs: [commenter]
96+
permissions:
97+
contents: write
98+
pull-requests: write
99+
runs-on: ubuntu-latest
100+
steps:
101+
- uses: ansys/actions/doc-changelog@v8
102+
with:
103+
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
104+
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
105+
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
106+

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This project uses [towncrier](https://towncrier.readthedocs.io/). Changes for
2+
the upcoming release can be found in
3+
[doc/source/changelog.rst](doc/source/changelog.rst).

doc/changelog/613.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
feat: changelog actions

doc/changelog/template

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{% if sections[""] %}
2+
{% for category, val in definitions.items() if category in sections[""] %}
3+
4+
{{ definitions[category]['name'] }}
5+
{% set underline = '^' * definitions[category]['name']|length %}
6+
{{ underline }}
7+
8+
{% for text, values in sections[""][category].items() %}
9+
- {{ text }} {{ values|join(', ') }}
10+
{% endfor %}
11+
12+
{% endfor %}
13+
{% else %}
14+
No significant changes.
15+
16+
17+
{% endif %}

doc/source/changelog.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Release notes
2+
#############
3+
4+
This document contains the release notes for the PyDyna project.
5+
6+
.. vale off
7+
8+
.. towncrier release notes start
9+
10+
.. vale on

doc/source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
# Read link all targets from file
9797
with open("links.rst") as f:
9898
rst_epilog += f.read()
99+
linkcheck_exclude_documents = ["changelog"]
99100

100101
inheritance_graph_attrs = dict(rankdir="RL", size='"8.0, 10.0"', fontsize=14, ratio="compress")
101102
inheritance_node_attrs = dict(shape="ellipse", fontsize=14, height=0.75, color="dodgerblue1", style="filled")

doc/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ PyDYNA documentation |version|
1818
examples/index
1919
{% endif %}
2020
contributing
21+
changelog

pyproject.toml

Lines changed: 56 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"
44

55
[project]
66
name = "ansys-dyna-core"
7-
version = "0.4.dev0"
7+
version = "0.6.dev0"
88
description = "Python interface to LS-DYNA Service"
99
readme = "README.rst"
1010
requires-python = ">=3.10,<4"
@@ -83,10 +83,10 @@ doc = [
8383
name = "ansys.dyna.core"
8484

8585
[project.urls]
86-
Source = "https://github.com/pyansys/pydyna"
86+
Source = "https://github.com/ansys/pydyna"
8787
Homepage = "https://dyna.docs.pyansys.com"
8888
Documentation = "https://dyna.docs.pyansys.com"
89-
Tracker = "https://github.com/pyansys/pydyna/issues"
89+
Tracker = "https://github.com/ansys/pydyna/issues"
9090

9191
[tool.black]
9292
line-length = 120
@@ -108,3 +108,56 @@ show_missing = true
108108
minversion = "7.1"
109109
addopts = "-ra --cov=ansys.dyna.core --cov-report html:.cov/html --cov-report xml:.cov/xml --cov-report term -vv"
110110
testpaths = ["tests"]
111+
112+
[tool.towncrier]
113+
directory = "doc/changelog"
114+
filename = "doc/source/changelog.rst"
115+
template = "doc/changelog/template"
116+
start_string = ".. towncrier release notes start\n"
117+
title_format = "`{version} <https://github.com/ansys/pydyna/releases/tag/v{version}>`_ - {project_date}"
118+
issue_format = "`#{issue} <https://github.com/ansys/pydyna/pull/{issue}>`_"
119+
120+
[[tool.towncrier.type]]
121+
directory = "added"
122+
name = "Added"
123+
showcontent = true
124+
125+
[[tool.towncrier.type]]
126+
directory = "dependencies"
127+
name = "Dependencies"
128+
showcontent = true
129+
130+
[[tool.towncrier.type]]
131+
directory = "documentation"
132+
name = "Documentation"
133+
showcontent = true
134+
135+
[[tool.towncrier.type]]
136+
directory = "fixed"
137+
name = "Fixed"
138+
showcontent = true
139+
140+
[[tool.towncrier.type]]
141+
directory = "maintenance"
142+
name = "Maintenance"
143+
showcontent = true
144+
145+
[[tool.towncrier.type]]
146+
directory = "miscellaneous"
147+
name = "Miscellaneous"
148+
showcontent = true
149+
150+
[[tool.towncrier.type]]
151+
directory = "documentation"
152+
name = "Documentation"
153+
showcontent = true
154+
155+
[[tool.towncrier.type]]
156+
directory = "maintenance"
157+
name = "Maintenance"
158+
showcontent = true
159+
160+
[[tool.towncrier.type]]
161+
directory = "test"
162+
name = "Test"
163+
showcontent = true

0 commit comments

Comments
 (0)