Skip to content

Commit

Permalink
feat: add changelog action (#1023)
Browse files Browse the repository at this point in the history
Co-authored-by: pyansys-ci-bot <[email protected]>
Co-authored-by: Roberto Pastor Muela <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
  • Loading branch information
4 people authored Mar 13, 2024
1 parent 4a4c483 commit 6524f6b
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -83,3 +87,15 @@ jobs:
- [good first issue](https://github.com/ansys/pyansys-geometry/pulls?q=label%3Agood+first+issue)
- [maintenance](https://github.com/ansys/pyansys-geometry/pulls?q=label%3Amaintenance+)
- [release](https://github.com/ansys/pyansys-geometry/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@main
with:
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# CHANGELOG
# CHANGELOG

This project uses [towncrier](https://towncrier.readthedocs.io/) to generate changelogs. You can see the changes for the upcoming release in <https://github.com/ansys/{repo-name}/tree/main/changelog.d/>.

<!-- towncrier release notes start -->
1 change: 1 addition & 0 deletions doc/changelog.d/1023.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
feat: add changelog action
15 changes: 15 additions & 0 deletions doc/changelog.d/changelog_template.jinja
Original file line number Diff line number Diff line change
@@ -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 %}
34 changes: 34 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,37 @@ show_missing = true
minversion = "7.1"
addopts = "-ra --cov=ansys.geometry --cov-report html:.cov/html --cov-report xml:.cov/xml --cov-report term -vv --image_cache_dir tests/integration/image_cache --add_missing_images"
testpaths = ["tests"]

[tool.towncrier]
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/pyansys-geometry/releases/tag/v{version}) - {project_date}"
issue_format = "[#{issue}](https://github.com/ansys/pyansys-geometry/pull/{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

0 comments on commit 6524f6b

Please sign in to comment.