Skip to content

Commit 162bba6

Browse files
authored
πŸ“ Docs: Create and update CHANGELOG.md using changelog-from-release (#164)
* πŸ“ Docs(CHANGELOG.md): create file with header * πŸ‘· CI(.github/workflows/docs.yml): Add github action to update changelog after every release * πŸ“ Docs(README.md): update contributing section with info about commits and changelog * πŸ“ Docs: update split_readme.py to copy CHANGELOG.md and add it to the docs
1 parent 42d56c5 commit 162bba6

File tree

5 files changed

+46
-2
lines changed

5 files changed

+46
-2
lines changed

β€Ž.github/workflows/docs.ymlβ€Ž

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,24 @@ jobs:
6363
github_token: ${{ secrets.GITHUB_TOKEN }}
6464
publish_dir: docs/
6565
publish_branch: streamlit-report-example
66+
67+
changelog:
68+
name: Update changelog
69+
if: github.event_name == 'release' && github.event.action == 'published'
70+
runs-on: ubuntu-latest
71+
steps:
72+
- name: Checkout main branch
73+
uses: actions/checkout@v4
74+
with:
75+
ref: main
76+
77+
- name: Update CHANGELOG.md
78+
uses: rhysd/changelog-from-release/action@v3
79+
with:
80+
file: CHANGELOG.md
81+
github_token: ${{ secrets.GITHUB_TOKEN }}
82+
header: |
83+
# Release Notes
84+
85+
All notable changes to this project are documented in this file. It was automatically generated with
86+
the [changelog-from-release](https://github.com/rhysd/changelog-from-release) tool.

β€ŽCHANGELOG.mdβ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Release Notes
2+
3+
All notable changes to this project are documented in this file. It was automatically generated with
4+
the [changelog-from-release](https://github.com/rhysd/changelog-from-release) tool.

β€ŽREADME.mdβ€Ž

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,14 @@ Full details for both licenses can be found in the [LICENSE][vuegen-license] fil
406406

407407
## Contributing
408408

409-
VueGen is an open-source project, and we welcome contributions of all kinds via GitHub issues and pull requests. You can report bugs, suggest improvements, propose new features, or implement changes. Please follow the guidelines in the [CONTRIBUTING](CONTRIBUTING.md) file to ensure that your contribution is easily integrated into the project.
409+
VueGen is an open-source project, and we welcome contributions of all kinds via GitHub issues and pull requests.
410+
You can report bugs, suggest improvements, propose new features, or implement changes.
411+
412+
We follow the [Conventional Commits][conventional-commits] specification for commit messages and use the
413+
[changelog-from-release][changelog-from-release-repo] tool to automatically generate the [CHANGELOG](CHANGELOG.md).
414+
415+
Please follow the guidelines in the [CONTRIBUTING](CONTRIBUTING.md) file to ensure that your contribution is
416+
easily integrated into the project.
410417

411418
## Credits and acknowledgements
412419

@@ -488,6 +495,8 @@ We appreciate your feedback! If you have any comments, suggestions, or run into
488495
[st-cloud]: https://streamlit.io/cloud
489496
[stlite_repo]: https://github.com/whitphx/stlite
490497
[st-forum-exe]: https://discuss.streamlit.io/t/streamlit-deployment-as-an-executable-file-exe-for-windows-macos-and-android/6812
498+
[conventional-commits]: https://www.conventionalcommits.org/
499+
[changelog-from-release-repo]: https://github.com/rhysd/changelog-from-release
491500
[Mona]: https://multiomics-analytics-group.github.io/
492501
[Biosustain]: https://www.biosustain.dtu.dk/
493502
[scriberia]: https://www.scriberia.co.uk/

β€Ždocs/index.mdβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ reference/vuegen
5050
sections_readme/contributing
5151
sections_readme/credits
5252
sections_readme/contact
53+
sections_readme/changelog
5354
```
5455

5556
```{toctree}

β€Ždocs/split_readme.pyβ€Ž

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def process_readme(readme_path, output_dir):
106106
else:
107107
raise ValueError(f"Section '{section_title}' not found in README")
108108

109-
# Include CONTRIBUTING.md with its own link references
109+
# Copy CONTRIBUTING.md with its own link references
110110
contrib_path = readme_path.parent / "CONTRIBUTING.md"
111111
try:
112112
raw_contrib = contrib_path.read_text()
@@ -124,6 +124,15 @@ def process_readme(readme_path, output_dir):
124124
except FileNotFoundError as e:
125125
raise FileNotFoundError(f"CONTRIBUTING.md not found at {contrib_path}") from e
126126

127+
# Copy CHANGELOG.md to the output directory
128+
changelog_path = readme_path.parent / "CHANGELOG.md"
129+
try:
130+
raw_changelog = changelog_path.read_text()
131+
(output_dir / "changelog.md").write_text(raw_changelog)
132+
print("Generated changelog.md")
133+
except FileNotFoundError as e:
134+
raise FileNotFoundError(f"CHANGELOG.md not found at {changelog_path}") from e
135+
127136

128137
if __name__ == "__main__":
129138
default_readme = Path(__file__).resolve().parent.parent / "README.md"

0 commit comments

Comments
Β (0)