From 4ed19a9b74c3811b2cc5c39b90f083e696f3fcee Mon Sep 17 00:00:00 2001 From: osoucy Date: Tue, 12 Dec 2023 23:15:31 -0500 Subject: [PATCH] Update --- .github/scripts/bump_version.py | 11 ++++++----- .github/scripts/write_release_body.py | 17 +++++++++++------ CHANGELOG.md | 18 +++++++++--------- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/.github/scripts/bump_version.py b/.github/scripts/bump_version.py index 93248ce..1a7e4c9 100644 --- a/.github/scripts/bump_version.py +++ b/.github/scripts/bump_version.py @@ -4,7 +4,8 @@ from packaging import version script_root = os.path.dirname(__file__) -laktory_root = "./settus/" +package_name = "settus" +laktory_root = f"./{package_name}/" def main(): @@ -66,13 +67,13 @@ def update_changelog(changelog_filepath, v0, v1): '# Release History', '', f'## [{v1}] - Unreleased', - '###Added', + '### Added', '* n/a', - '###Fixed', + '### Fixed', '* n/a', - '###Updated', + '### Updated', '* n/a', - '###Breaking changes', + '### Breaking changes', '* n/a', '' ] diff --git a/.github/scripts/write_release_body.py b/.github/scripts/write_release_body.py index 4103c6d..a8dd092 100644 --- a/.github/scripts/write_release_body.py +++ b/.github/scripts/write_release_body.py @@ -17,25 +17,30 @@ def main(): # Read version file with open(version_filepath) as fp: - v0 = fp.read().split("=")[-1].strip().replace('"', '') - print(f"Get changes for {package_name} {v0}") + release_version = fp.read().split("=")[-1].strip().replace('"', '') + print(f"Get changes for {package_name} {release_version}") # Read changelog with open(changelog_filepath, 'r') as fp: content = fp.read() + blocks = content.split("## [") # Select latest changes - content = content.split("## ")[1] - content = "\n".join(content.split("\n")[1:]).strip() + changes = blocks[1] + changes = "\n".join(changes.split("\n")[1:]).strip() print("Release Content") print("---------------") - print(content) + print(changes) print("--------------") + # Add compare to previous release + previous_version = blocks[2].split("]")[0] + changes += f"\nFull [Changelog](https://github.com/okube-ai/{package_name}/compare/v{previous_version}...v{release_version}/)" + # Write body print(f"Writing body {body_filepath}") with open(body_filepath, 'w') as fp: - fp.write(content) + fp.write(changes) if os.getenv("GITHUB_OUTPUT") is None: os.remove(body_filepath) diff --git a/CHANGELOG.md b/CHANGELOG.md index 920388a..8df0004 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,39 +1,39 @@ # Release History ## [0.0.9] - Unreleased -###Added +### Added * Documentation ## [0.0.8] - 2023-09-24 -###Added +### Added * Lean tests for installation without optional dependencies ## [0.0.7] - 2023-09-24 -###Fixed +### Fixed * ModuleNotFoundError with optional dependencies ## [0.0.6] - 2023-09-23 -###Fixed +### Fixed * ModuleNotFoundError with optional dependencies ###Updated * Documentation to include required environment variables. ## [0.0.5] - 2023-09-22 -###Added +### Added * Support for AWS secrets ## [0.0.4] - 2023-09-21 -###Added +### Added * Support for the same alias(es) used across multiple fields ## [0.0.3] - 2023-09-17 -###Added +### Added * Azure Keyvault support ## [0.0.2] - 2023-07-30 -###Updated +### Updated * Changed build backend from flit to setuptools ## [0.0.1] - 2023-07-16 -###Added +### Added * Initial pypi release