From 7197b36076da67003cc0b27c648cda52be010057 Mon Sep 17 00:00:00 2001 From: Daniel Roy Greenfeld Date: Tue, 26 Sep 2023 16:34:46 +0100 Subject: [PATCH] Release 0.2.2 (#27) --- CHANGELOG.md | 11 ++++++++++- Makefile | 11 ++++++----- pyproject.toml | 2 +- utils/update_changelog.py | 29 +++++++++++++++++++++++++++++ 4 files changed, 46 insertions(+), 7 deletions(-) create mode 100644 utils/update_changelog.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 1333ed7..58e5897 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1,10 @@ -TODO +# [v0.2.2](https://github.com/pydanny/dj-notebook/releases/tag/v0.2.2) + +2023-09-26T15:24:15Z by +[@pydanny](https://github.com/pydanny) + +## ## What's Changed +* Correct the release notes by @pydanny in https://github.com/pydanny/dj-notebook/pull/26 + + +**Full Changelog**: https://github.com/pydanny/dj-notebook/compare/v0.2.1...v0.2.2 diff --git a/Makefile b/Makefile index d106ecd..e45d396 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,11 @@ changelog: # Install gh cli and jq first gh api \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - /repos/pydanny/dj_notebook/releases/latest > changelog.json - jq -r '.tag_name' changelog.json - jq -r '.body' changelog.json + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + /repos/pydanny/dj-notebook/releases/latest > changelog.json + + python utils/update_changelog.py + rm changelog.json lint: black . diff --git a/pyproject.toml b/pyproject.toml index 781610d..a545491 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "dj_notebook" -version = "0.2.1" +version = "0.2.2" description = "A Jupyter notebook with access to objects from the Django ORM is a powerful tool to introspect data and run ad-hoc queries." readme = "README.md" authors = [ diff --git a/utils/update_changelog.py b/utils/update_changelog.py new file mode 100644 index 0000000..986437c --- /dev/null +++ b/utils/update_changelog.py @@ -0,0 +1,29 @@ +import json +import pathlib +import typing + + +def main() -> None: + changes: dict[str, typing.Any] = json.loads( + pathlib.Path("changelog.json").read_text() + ) + previous_changelog: str = pathlib.Path("CHANGELOG.md").read_text() + + new_changelog: str = f""" +# [{changes["tag_name"]}]({changes['html_url']}) + +{changes['created_at']} by +[@{changes['author']['login']}]({changes['author']['html_url']}) + +## {changes["body"]} + +--- + +{previous_changelog} +""" + + pathlib.Path("CHANGELOG.md").write_text(new_changelog) + + +if __name__ == "__main__": + main()