Skip to content

Commit d21bb54

Browse files
feat: Add changelog
1 parent 0b9d84d commit d21bb54

File tree

4 files changed

+151
-1
lines changed

4 files changed

+151
-1
lines changed

.github/workflows/label.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Labeler
2+
3+
on:
4+
pull_request:
5+
# opened, reopened, and synchronize are default for pull_request
6+
# edited - when PR title or body is changed
7+
# labeled - when labels are added to PR
8+
types: [opened, reopened, synchronize, edited, labeled]
9+
push:
10+
branches: [ main ]
11+
paths:
12+
- '../labels.yml'
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
label-syncer:
20+
name: Syncer
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: micnncim/action-label-syncer@v1
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
28+
labeler:
29+
name: Set labels
30+
needs: [label-syncer]
31+
permissions:
32+
contents: read
33+
pull-requests: write
34+
runs-on: ubuntu-latest
35+
steps:
36+
# Label based on modified files
37+
- name: Label based on changed files
38+
uses: actions/labeler@v5
39+
with:
40+
repo-token: ${{ secrets.GITHUB_TOKEN }}
41+
sync-labels: true
42+
43+
- uses: actions-ecosystem/action-add-labels@v1
44+
if: |
45+
startsWith(github.event.pull_request.head.ref, 'doc') ||
46+
startsWith(github.event.pull_request.head.ref, 'docs')
47+
with:
48+
labels: documentation
49+
- uses: actions-ecosystem/action-add-labels@v1
50+
if: |
51+
startsWith(github.event.pull_request.head.ref, 'maint') ||
52+
startsWith(github.event.pull_request.head.ref, 'no-ci') ||
53+
startsWith(github.event.pull_request.head.ref, 'ci')
54+
with:
55+
labels: maintenance
56+
57+
- uses: actions-ecosystem/action-add-labels@v1
58+
if: startsWith(github.event.pull_request.head.ref, 'feat')
59+
with:
60+
labels: enhancement
61+
62+
- uses: actions-ecosystem/action-add-labels@v1
63+
if: |
64+
startsWith(github.event.pull_request.head.ref, 'fix') ||
65+
startsWith(github.event.pull_request.head.ref, 'patch')
66+
with:
67+
labels: bug
68+
69+
commenter:
70+
runs-on: ubuntu-latest
71+
steps:
72+
- name: Suggest to add labels
73+
uses: peter-evans/create-or-update-comment@v4
74+
# Execute only when no labels have been applied to the pull request
75+
if: toJSON(github.event.pull_request.labels.*.name) == '{}'
76+
with:
77+
issue-number: ${{ github.event.pull_request.number }}
78+
body: |
79+
Please add one of the following labels to add this contribution to the Release Notes :point_down:
80+
- [bug](https://github.com/ansys/ansys-tools-visualization-interface/pulls?q=label%3Abug+)
81+
- [documentation](https://github.com/ansys/ansys-tools-visualization-interface/pulls?q=label%3Adocumentation+)
82+
- [enhancement](https://github.com/ansys/ansys-tools-visualization-interface/pulls?q=label%3Aenhancement+)
83+
- [good first issue](https://github.com/ansys/ansys-tools-visualization-interface/pulls?q=label%3Agood+first+issue)
84+
- [maintenance](https://github.com/ansys/ansys-tools-visualization-interface/pulls?q=label%3Amaintenance+)
85+
- [release](https://github.com/ansys/ansys-tools-visualization-interface/pulls?q=label%3Arelease+)
86+
87+
changelog-fragment:
88+
name: "Create changelog fragment"
89+
needs: [labeler]
90+
permissions:
91+
contents: write
92+
pull-requests: write
93+
runs-on: ubuntu-latest
94+
steps:
95+
- uses: ansys/actions/doc-changelog@v6
96+
with:
97+
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}

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/) and the changes for the upcoming release can be found in <https://github.com/ansys/ansys-tools-visualization-interface/tree/main/doc/changelog.d/>.
2+
3+
<!-- towncrier release notes start -->
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{% if sections[""] %}
2+
{% for category, val in definitions.items() if category in sections[""] %}
3+
4+
### {{ definitions[category]['name'] }}
5+
6+
{% for text, values in sections[""][category].items() %}
7+
- {{ text }} {{ values|join(', ') }}
8+
{% endfor %}
9+
10+
{% endfor %}
11+
{% else %}
12+
No significant changes.
13+
14+
15+
{% endif %}

pyproject.toml

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

55
[project]
66
name = "ansys-tools-visualization-interface"
7-
version = "0.2.dev0"
7+
version = "0.2.0"
88
description = "A Python visualization interface for PyAnsys libraries"
99
readme = "README.rst"
1010
requires-python = ">=3.9,<4"
@@ -91,3 +91,38 @@ known-first-party = ["ansys"]
9191
[tool.ruff.lint.pydocstyle]
9292
# Settings: https://docs.astral.sh/ruff/settings/#lintpydocstyle
9393
convention = "google"
94+
95+
[tool.towncrier]
96+
package = "ansys.tools.visualization_interface"
97+
directory = "doc/changelog.d"
98+
filename = "CHANGELOG.md"
99+
start_string = "<!-- towncrier release notes start -->\n"
100+
underlines = ["", "", ""]
101+
template = "doc/changelog.d/changelog_template.jinja"
102+
title_format = "## [{version}](https://github.com/ansys/{repo-name}/releases/tag/v{version}) - {project_date}"
103+
issue_format = "[#{issue}](https://github.com/ansys/{repo-name}/pull/{issue})"
104+
105+
[[tool.towncrier.type]]
106+
directory = "added"
107+
name = "Added"
108+
showcontent = true
109+
110+
[[tool.towncrier.type]]
111+
directory = "changed"
112+
name = "Changed"
113+
showcontent = true
114+
115+
[[tool.towncrier.type]]
116+
directory = "fixed"
117+
name = "Fixed"
118+
showcontent = true
119+
120+
[[tool.towncrier.type]]
121+
directory = "dependencies"
122+
name = "Dependencies"
123+
showcontent = true
124+
125+
[[tool.towncrier.type]]
126+
directory = "miscellaneous"
127+
name = "Miscellaneous"
128+
showcontent = true

0 commit comments

Comments
 (0)