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

towncrier for the changelog #13882

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion .github/workflows/upload-pypi-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive

- uses: Chia-Network/actions/setup-python@main
name: Install Python
Expand All @@ -50,6 +49,10 @@ jobs:
python -m pip install --upgrade pip setuptools wheel
python -m pip install .[dev]

- name: Require change fragment
run: |
towncrier check --compare-with "origin/${{ github.event.pull_request.base.ref }}"

- name: Lint source with black
run: |
black --check --diff .
Expand Down Expand Up @@ -83,3 +86,40 @@ jobs:
TWINE_NON_INTERACTIVE: 1
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: twine upload --non-interactive --skip-existing --verbose 'dist/*'

build_changelog:
name: Build changelog
runs-on: [ubuntu-latest]

steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: Chia-Network/actions/setup-python@main
name: Install Python
with:
python-version: '3.8'

- uses: ./.github/actions/install
with:
python-version: '3.8'
development: true

- uses: chia-network/actions/activate-venv@main

- name: Create single version changlog summary
run: |
towncrier build --yes --draft >> $GITHUB_STEP_SUMMARY

- name: Build changelog
run: |
towncrier build --yes

- name: Publish changelog artifact
uses: actions/upload-artifact@v3
with:
name: changelog
path: CHANGELOG.md
if-no-files-found: error
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project does not yet adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
for setuptools_scm/PEP 440 reasons.

<!-- towncrier start string -->
## 1.6.1 Chia blockchain 2022-11-03

### Added
Expand Down
1 change: 1 addition & 0 deletions changes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.gitignore
13 changes: 13 additions & 0 deletions changes/template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## {{ versiondata.version }} Chia blockchain {{ versiondata.date }}

{% for section, _ in sections.items() %}
{% for category, val in definitions.items() if category in sections[section]%}
### {{ definitions[category]['name'] }}

{% if definitions[category]['showcontent'] %}
{% for text, values in sections[section][category].items() %}
- {{ text }}
{% endfor %}
{% endif %}
{% endfor %}
{% endfor %}
1 change: 1 addition & 0 deletions changes/x.added
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Started using towncrier. https://towncrier.readthedocs.io/en/stable/
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"aiohttp_cors", # For blackd
"ipython", # For asyncio debugging
"pyinstaller==5.3",
"towncrier",
"types-aiofiles",
"types-cryptography",
"types-pkg_resources",
Expand Down
29 changes: 29 additions & 0 deletions towncrier.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[tool.towncrier]
directory = "changes"
filename = "CHANGELOG.md"
package = "chia"
start_string = "<!-- towncrier start string -->"
template = "changes/template.md"
#title_format = "{version} {name} {project_date}"
#underlines = " "

[tool.towncrier.fragment.added]
name ="Added"

[tool.towncrier.fragment.changed]
name = "Changed"

[tool.towncrier.fragment.deprecated]
name = "Deprecated"

[tool.towncrier.fragment.removed]
name = "Removed"

[tool.towncrier.fragment.fixed]
name = "Fixed"

[tool.towncrier.fragment.security]
name = "Security"

[tool.towncrier.fragment.misc]
showcontent = false