Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: changelog actions #613

Merged
merged 14 commits into from
Nov 15, 2024
Merged
16 changes: 15 additions & 1 deletion .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@ 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 }}

code-style:
name: "Code style"
runs-on: ubuntu-latest
Expand Down Expand Up @@ -288,7 +302,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
12 changes: 12 additions & 0 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,15 @@ 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 }}
jorgepiloto marked this conversation as resolved.
Show resolved Hide resolved
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).
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 %}
8 changes: 8 additions & 0 deletions doc/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Release notes
#############

This document contains the release notes for the PyDyna project.

.. vale off

.. towncrier release notes start
jorgepiloto marked this conversation as resolved.
Show resolved Hide resolved
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
Loading