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

RELEASE #41

Merged
merged 3 commits into from
Sep 18, 2024
Merged
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
20 changes: 16 additions & 4 deletions .ci/update_setup_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,16 @@ def update_version(self, is_release=False):
print(f"Version bumped up from {current_version} to {new_version}")
return new_version

def update_change_log(self):
def update_change_log(self, is_releasing=False):
change_log_path = os.path.join(self.root_dir, 'CHANGELOG.md')
change_log_blob = [
f'## [{new_version_from_setup}] - {datetime.now().strftime("%Y-%m-%d")}',
self.change_log_line,
f'- [#{self.pr_number}](https://github.com/unity-sds/unity-data-services/pull/{self.pr_number}) {self.pr_title}',
''
]
if is_releasing:
change_log_blob.append('-----------------------------------------')
with open(change_log_path, 'r') as change_log_file:
change_logs = change_log_file.read().splitlines()
pattern = r"## \[\d+\.\d+\.\d+.*\] - \d{4}-\d{2}-\d{2}"
Expand Down Expand Up @@ -120,8 +122,18 @@ def generate_release_msg(self):
with open(change_log_path, 'r') as ff:
all_lines = ff.read().splitlines()
i = 0
start = end = -1 # Find the previous version section range
while i < len(all_lines):
if f'{software_version}.dev' not in all_lines[i]:
if '-----------------------------------------' in all_lines[i]:
if start == end:
start = i+1
else:
end = i
break
i += 1
i = start
while i < end:
if f'.dev' not in all_lines[i]:
i += 1
continue
release_lines[all_lines[i+1].replace('###', '').strip()].append(all_lines[i+2])
Expand Down Expand Up @@ -150,7 +162,7 @@ def generate_release_msg(self):
new_version_from_setup = version_update.generate_release_msg()
elif argv[1].strip().upper() == 'RELEASE':
new_version_from_setup = version_update.update_version(True)
version_update.update_change_log()
version_update.update_change_log(True)
else:
new_version_from_setup = version_update.update_version(False)
version_update.update_change_log()
version_update.update_change_log(False)
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

===================================================================

## [0.5.0.dev000001] - 2024-09-18
### Fixed
- [#39](https://github.com/unity-sds/unity-data-services/pull/39) fix: logic is a bit wrong

## [0.5.0] - 2024-09-18

- [#36](https://github.com/unity-sds/unity-data-services/pull/36) release

-----------------------------------------
## [0.4.0.dev000200] - 2024-09-18
### Changed
- [#34](https://github.com/unity-sds/unity-data-services/pull/34) feat: new ways to write release notes
Expand All @@ -17,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- [#32](https://github.com/unity-sds/unity-data-services/pull/32) release

-----------------------------------------
## [0.3.0.dev000100] - 2024-09-18
### Changed
- [#30](https://github.com/unity-sds/unity-data-services/pull/30) feat: merge into a single ci/cd
Expand All @@ -25,6 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- [#27](https://github.com/unity-sds/unity-data-services/pull/27) release

-----------------------------------------
## [0.2.0.dev000100] - 2024-09-17
### Changed
- [#21](https://github.com/unity-sds/unity-data-services/pull/21) feat: sample feature
Expand All @@ -33,10 +42,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- [#19](https://github.com/unity-sds/unity-data-services/pull/19) release

-----------------------------------------
## [0.1.1] - 2024-09-11

- [#16](https://github.com/unity-sds/unity-data-services/pull/16) release

-----------------------------------------
## [0.1.0.dev000005] - 2024-09-10
### Fixed
- [#13](https://github.com/unity-sds/unity-data-services/pull/13) fix: wrong insertion location in changelog
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "mdps-ds-lib"
version="0.5.0"
version="0.5.0.dev000001"
description = "Mission Data System - MDPS (Unity) Data Service Core library"
authors = ["Wai Phyo <wai.phyo@jpl.nasa.gov>"]
license = "Apache 2.0"
Expand Down
Loading