From 861dcc5ca9915d1410befe389b2b09c048d9c449 Mon Sep 17 00:00:00 2001 From: Wai Phyo Date: Mon, 9 Sep 2024 10:32:59 -0700 Subject: [PATCH 1/7] fix: updating old ci.cd folder --- .github/workflows/feature_pr_merge.yml | 6 +++--- .github/workflows/release_pr_create.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/feature_pr_merge.yml b/.github/workflows/feature_pr_merge.yml index c5973d3..5ae1577 100644 --- a/.github/workflows/feature_pr_merge.yml +++ b/.github/workflows/feature_pr_merge.yml @@ -22,7 +22,7 @@ jobs: - run: | echo "${PR_TITLE} -- ${PR_NUMBER}" - run: | - python3 "${GITHUB_WORKSPACE}/ci.cd/update_setup_version.py" FEATURE + python3 "${GITHUB_WORKSPACE}/.ci/update_setup_version.py" FEATURE - run: | - chmod +x "${GITHUB_WORKSPACE}/ci.cd/update_version_commit.sh" - "${GITHUB_WORKSPACE}/ci.cd/update_version_commit.sh" + chmod +x "${GITHUB_WORKSPACE}/.ci/update_version_commit.sh" + "${GITHUB_WORKSPACE}/.ci/update_version_commit.sh" diff --git a/.github/workflows/release_pr_create.yml b/.github/workflows/release_pr_create.yml index 02b8945..ff3999f 100644 --- a/.github/workflows/release_pr_create.yml +++ b/.github/workflows/release_pr_create.yml @@ -21,7 +21,7 @@ jobs: - run: | echo "${PR_TITLE} -- ${PR_NUMBER}" - run: | - python3 "${GITHUB_WORKSPACE}/ci.cd/update_setup_version.py" RELEASE + python3 "${GITHUB_WORKSPACE}/.ci/update_setup_version.py" RELEASE - run: | - chmod +x "${GITHUB_WORKSPACE}/ci.cd/update_version_commit.sh" - "${GITHUB_WORKSPACE}/ci.cd/update_version_commit.sh" + chmod +x "${GITHUB_WORKSPACE}/.ci/update_version_commit.sh" + "${GITHUB_WORKSPACE}/.ci/update_version_commit.sh" From 0468c16c0de87a5cf12dc46eb8e20c5cb51a5e76 Mon Sep 17 00:00:00 2001 From: Wai Phyo Date: Mon, 9 Sep 2024 10:46:40 -0700 Subject: [PATCH 2/7] fix: updating github actions --- .ci/update_setup_version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/update_setup_version.py b/.ci/update_setup_version.py index 8b1490c..b0f4268 100644 --- a/.ci/update_setup_version.py +++ b/.ci/update_setup_version.py @@ -57,7 +57,7 @@ def update_version(self, is_release=False): if is_release and '-D-' not in current_version: raise ValueError(f'no development updates to release: {current_version}') - main_version, dev_version = current_version.split('-D-') + main_version, dev_version = current_version.split('-D-') if '-D-' in current_version else [current_version, '0.0.0'] if is_release: print('this is a formal release') self.major1, self.minor1, self.patch1 = [int(k) for k in dev_version.split('.')] @@ -110,5 +110,5 @@ def update_change_log(self): if __name__ == '__main__': is_releasing = argv[1].strip().upper() == 'RELEASE' version_update = VersionUpdate() - new_version_from_setup = version_update.update_version(True) + new_version_from_setup = version_update.update_version(is_releasing) version_update.update_change_log() From fafc1b22bb1e2425c92bbe9a00c76742fca7968d Mon Sep 17 00:00:00 2001 From: Wai Phyo Date: Mon, 9 Sep 2024 11:02:24 -0700 Subject: [PATCH 3/7] fix: feature release update --- .github/workflows/feature_pr_pypi.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/feature_pr_pypi.yml b/.github/workflows/feature_pr_pypi.yml index e4fdbd9..c26d78b 100644 --- a/.github/workflows/feature_pr_pypi.yml +++ b/.github/workflows/feature_pr_pypi.yml @@ -1,4 +1,4 @@ -name: Feature PR Merge +name: Feature PR PYPI on: pull_request: types: [ closed ] @@ -16,14 +16,13 @@ jobs: if_merged: if: github.event.pull_request.merged == true && (contains(github.event.pull_request.title, 'update version + change log')) runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v3 with: python-version: '3.9' - run: | - python3 -m pip python3 -m pip install poetry + python3 -m pip install poetry - run: | python3 -m poetry build - run: | From 6220c0086adf082c57f087695ad117342d585c07 Mon Sep 17 00:00:00 2001 From: Wai Phyo Date: Tue, 10 Sep 2024 09:36:45 -0700 Subject: [PATCH 4/7] fix: valid pypi version --- .ci/update_setup_version.py | 9 +++++---- pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.ci/update_setup_version.py b/.ci/update_setup_version.py index b0f4268..9b19538 100644 --- a/.ci/update_setup_version.py +++ b/.ci/update_setup_version.py @@ -54,10 +54,11 @@ def update_version(self, is_release=False): # Find the current version using the regular expression pattern current_version = re.search(self.version_pattern, setup_contents).group(1) print(f'current_version: {current_version}') - if is_release and '-D-' not in current_version: + if is_release and '.dev' not in current_version: raise ValueError(f'no development updates to release: {current_version}') - main_version, dev_version = current_version.split('-D-') if '-D-' in current_version else [current_version, '0.0.0'] + main_version, dev_version = current_version.split('.dev') if '.dev' in current_version else [current_version, '0' *6] + dev_version = '.'.join([dev_version[i:i+2] for i in range(0, 6, 2)]) if is_release: print('this is a formal release') self.major1, self.minor1, self.patch1 = [int(k) for k in dev_version.split('.')] @@ -65,8 +66,8 @@ def update_version(self, is_release=False): else: print('this is a feature merge') self.get_new_bumps_from_title() - new_version = self.get_new_version(dev_version) - new_version = f'{main_version}-D-{new_version}' + new_version = self.get_new_version(dev_version).replace('.', '') + new_version = f'{main_version}.dev{new_version}' print(f'new_version: {new_version}') # Replace the old version with the new version in setup.py diff --git a/pyproject.toml b/pyproject.toml index 238247b..0ea101d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "mdps-ds-lib" -version="0.1.0-D-0.0.2" +version="0.1.0.dev000002" description = "Mission Data System - MDPS (Unity) Data Service Core library" authors = ["Wai Phyo "] license = "Apache 2.0" From 16b73b81d770483a5b0d2dff48000378e5f45360 Mon Sep 17 00:00:00 2001 From: Wai Phyo Date: Tue, 10 Sep 2024 09:50:32 -0700 Subject: [PATCH 5/7] fix: add twine --- .github/workflows/release_pr_merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_pr_merge.yml b/.github/workflows/release_pr_merge.yml index 39a1cb8..02cff98 100644 --- a/.github/workflows/release_pr_merge.yml +++ b/.github/workflows/release_pr_merge.yml @@ -23,7 +23,7 @@ jobs: with: python-version: '3.9' - run: | - python3 -m pip python3 -m pip install poetry + python3 -m pip python3 -m pip install poetry twine - run: | python3 -m poetry build - run: | From fec2e499d6328b7e57f7f1f816bf30282c65e9c4 Mon Sep 17 00:00:00 2001 From: Wai Phyo Date: Tue, 10 Sep 2024 09:53:21 -0700 Subject: [PATCH 6/7] fix: wrong string format --- .ci/update_setup_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/update_setup_version.py b/.ci/update_setup_version.py index adfc5da..6b41c80 100644 --- a/.ci/update_setup_version.py +++ b/.ci/update_setup_version.py @@ -66,7 +66,7 @@ def update_version(self, is_release=False): else: print('this is a feature merge') self.get_new_bumps_from_title() - new_version = ''.join([f'{i}:02' for i in self.get_new_version(dev_version).split('.')]) + new_version = ''.join([f'{i:02}' for i in self.get_new_version(dev_version).split('.')]) new_version = f'{main_version}.dev{new_version}' print(f'new_version: {new_version}') From 0842519675f4aec72944ebcbe5d1d44a419f7d49 Mon Sep 17 00:00:00 2001 From: Wai Phyo Date: Tue, 10 Sep 2024 09:59:31 -0700 Subject: [PATCH 7/7] fix: typo in version --- .ci/update_setup_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/update_setup_version.py b/.ci/update_setup_version.py index 6b41c80..d5e5c3e 100644 --- a/.ci/update_setup_version.py +++ b/.ci/update_setup_version.py @@ -66,7 +66,7 @@ def update_version(self, is_release=False): else: print('this is a feature merge') self.get_new_bumps_from_title() - new_version = ''.join([f'{i:02}' for i in self.get_new_version(dev_version).split('.')]) + new_version = ''.join([f'{int(i):02}' for i in self.get_new_version(dev_version).split('.')]) new_version = f'{main_version}.dev{new_version}' print(f'new_version: {new_version}')