From 73aa6fb7d70df05d6c2dba3f823731e52d3ed904 Mon Sep 17 00:00:00 2001 From: cenevan <92879012+cenevan@users.noreply.github.com> Date: Thu, 16 May 2024 17:01:43 -0700 Subject: [PATCH 01/36] Create publish-package.yml --- .github/workflows/publish-package.yml | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/publish-package.yml diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml new file mode 100644 index 0000000..cd15960 --- /dev/null +++ b/.github/workflows/publish-package.yml @@ -0,0 +1,31 @@ +name: publish package to PyPi + +on: + push: + branches: + - main + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - name: Install dependencies + run: pip install -r requirements.txt + + - name: Build package + run: python setup.py sdist bdist_wheel + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} From 3d40028658a2a66ff520531b6bb4d7552c6f3810 Mon Sep 17 00:00:00 2001 From: cenevan <92879012+cenevan@users.noreply.github.com> Date: Thu, 16 May 2024 18:13:46 -0700 Subject: [PATCH 02/36] basic version --- .github/workflows/publish-package.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index cd15960..9def005 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -6,8 +6,11 @@ on: - main jobs: + Timestamp: + uses: storyprotocol/gha-workflows/.github/workflows/reusable-timestamp.yml@main build: + needs: [Timestamp] runs-on: ubuntu-latest steps: - name: Checkout code @@ -25,7 +28,7 @@ jobs: run: python setup.py sdist bdist_wheel - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release + uses: pypa/gh-action-pypi-publish@v1.8.14 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} From 12892204b8030a981f2946f7c48e335806c34df3 Mon Sep 17 00:00:00 2001 From: cenevan <92879012+cenevan@users.noreply.github.com> Date: Thu, 23 May 2024 17:49:23 -0700 Subject: [PATCH 03/36] version changes --- .github/workflows/publish-package.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 9def005..d779cd2 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -12,14 +12,18 @@ jobs: build: needs: [Timestamp] runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["pypy3.9", "pypy3.10", "3.9", "3.10", "3.11", "3.12"] + steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 with: - python-version: 3.9 + python-version: ${{ matrix.python-version }} - name: Install dependencies run: pip install -r requirements.txt From 2d198333e1577c05dfe6ca6da3307fad46b2992e Mon Sep 17 00:00:00 2001 From: cenevan <92879012+cenevan@users.noreply.github.com> Date: Thu, 23 May 2024 17:51:02 -0700 Subject: [PATCH 04/36] workflow dispatch --- .github/workflows/publish-package.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index d779cd2..f337115 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -4,6 +4,7 @@ on: push: branches: - main + workflow_dispatch: jobs: Timestamp: From 12d3a35189a1ddeb29fed64fe4815bbc61471afa Mon Sep 17 00:00:00 2001 From: cenevan <92879012+cenevan@users.noreply.github.com> Date: Thu, 23 May 2024 18:10:55 -0700 Subject: [PATCH 05/36] dependencies --- .github/workflows/publish-package.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index f337115..d6cf969 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -27,7 +27,10 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies - run: pip install -r requirements.txt + run: | + pip install -r requirements.txt + python -m pip install --upgrade pip + pip install setuptools wheel - name: Build package run: python setup.py sdist bdist_wheel From 5d48efa162a97a2e766c4f82f19c855a5aaf37a3 Mon Sep 17 00:00:00 2001 From: cenevan <92879012+cenevan@users.noreply.github.com> Date: Thu, 23 May 2024 18:30:40 -0700 Subject: [PATCH 06/36] change version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 44c04b6..490c175 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='story_protocol_python_sdk', - version='0.2.1', + version='0.2.2', packages=find_packages(where='src', exclude=["tests"]), package_dir={'': 'src'}, install_requires=[ From aa127febf50f23c24301b683de6ee7788d7037e2 Mon Sep 17 00:00:00 2001 From: cenevan <92879012+cenevan@users.noreply.github.com> Date: Thu, 23 May 2024 19:00:23 -0700 Subject: [PATCH 07/36] auto version change --- .github/workflows/publish-package.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index d6cf969..b39e7ae 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -32,6 +32,25 @@ jobs: python -m pip install --upgrade pip pip install setuptools wheel + - name: Update package version + run: | + import re + from setuptools import setup + + with open('setup.py', 'r') as f: + setup_py = f.read() + + version = re.search(r"version='(\d+\.\d+\.\d+)'", setup_py).group(1) + major, minor, patch = map(int, version.split('.')) + patch += 1 + new_version = f"{major}.{minor}.{patch}" + + with open('setup.py', 'w') as f: + f.write(re.sub(r"version='(\d+\.\d+\.\d+)'", f"version='{new_version}'", setup_py)) + + with open('your_package/version.py', 'w') as f: + f.write(f"__version__ = '{new_version}'") + - name: Build package run: python setup.py sdist bdist_wheel From 6c8cb463b42471cef71c845a9cc304a62e015bc1 Mon Sep 17 00:00:00 2001 From: cenevan <92879012+cenevan@users.noreply.github.com> Date: Fri, 24 May 2024 10:26:23 -0700 Subject: [PATCH 08/36] fix matrix --- .github/workflows/publish-package.yml | 26 ++++++-------------------- setup.py | 2 +- update_version.py | 16 ++++++++++++++++ 3 files changed, 23 insertions(+), 21 deletions(-) create mode 100644 update_version.py diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index b39e7ae..bb7e557 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -31,29 +31,15 @@ jobs: pip install -r requirements.txt python -m pip install --upgrade pip pip install setuptools wheel - - - name: Update package version - run: | - import re - from setuptools import setup - - with open('setup.py', 'r') as f: - setup_py = f.read() - - version = re.search(r"version='(\d+\.\d+\.\d+)'", setup_py).group(1) - major, minor, patch = map(int, version.split('.')) - patch += 1 - new_version = f"{major}.{minor}.{patch}" - - with open('setup.py', 'w') as f: - f.write(re.sub(r"version='(\d+\.\d+\.\d+)'", f"version='{new_version}'", setup_py)) - - with open('your_package/version.py', 'w') as f: - f.write(f"__version__ = '{new_version}'") - name: Build package run: python setup.py sdist bdist_wheel - + + publish: + needs: [Timestamp, build] + runs-on: ubuntu-latest + + steps: - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@v1.8.14 with: diff --git a/setup.py b/setup.py index 490c175..a129dda 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='story_protocol_python_sdk', - version='0.2.2', + version='0.2.3', packages=find_packages(where='src', exclude=["tests"]), package_dir={'': 'src'}, install_requires=[ diff --git a/update_version.py b/update_version.py new file mode 100644 index 0000000..97d86bb --- /dev/null +++ b/update_version.py @@ -0,0 +1,16 @@ +import re +from setuptools import setup + +with open('setup.py', 'r') as f: + setup_py = f.read() + +version = re.search(r"version='(\d+\.\d+\.\d+)'", setup_py).group(1) +major, minor, patch = map(int, version.split('.')) +patch += 1 +new_version = f"{major}.{minor}.{patch}" + +with open('setup.py', 'w') as f: + f.write(re.sub(r"version='(\d+\.\d+\.\d+)'", f"version='{new_version}'", setup_py)) + +with open('your_package/version.py', 'w') as f: + f.write(f"__version__ = '{new_version}'") \ No newline at end of file From 4c1c79960f449110c14bc8ff0ae7096be011ea9c Mon Sep 17 00:00:00 2001 From: cenevan <92879012+cenevan@users.noreply.github.com> Date: Fri, 24 May 2024 10:33:48 -0700 Subject: [PATCH 09/36] test --- .github/workflows/publish-package.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index bb7e557..f3514f2 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -34,12 +34,14 @@ jobs: - name: Build package run: python setup.py sdist bdist_wheel - + publish: needs: [Timestamp, build] runs-on: ubuntu-latest steps: + - name: Build package + run: python setup.py sdist bdist_wheel - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@v1.8.14 with: From 5637e1c29546abaf039fb9c9ac63aff126ba54d9 Mon Sep 17 00:00:00 2001 From: cenevan <92879012+cenevan@users.noreply.github.com> Date: Fri, 24 May 2024 10:35:58 -0700 Subject: [PATCH 10/36] test2 --- .github/workflows/publish-package.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index f3514f2..32b460e 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -40,8 +40,15 @@ jobs: runs-on: ubuntu-latest steps: + - name: Install dependencies + run: | + pip install -r requirements.txt + python -m pip install --upgrade pip + pip install setuptools wheel + - name: Build package run: python setup.py sdist bdist_wheel + - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@v1.8.14 with: From 14cd80761cb221d1c9e2bafd230f5a247fdf6bcb Mon Sep 17 00:00:00 2001 From: cenevan <92879012+cenevan@users.noreply.github.com> Date: Fri, 24 May 2024 10:40:32 -0700 Subject: [PATCH 11/36] test3 --- .github/workflows/publish-package.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 32b460e..c87c9c8 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -34,21 +34,25 @@ jobs: - name: Build package run: python setup.py sdist bdist_wheel + + - name: Download build artifacts + uses: actions/download-artifact@v2 + with: + name: build-artifacts publish: needs: [Timestamp, build] runs-on: ubuntu-latest steps: - - name: Install dependencies - run: | - pip install -r requirements.txt - python -m pip install --upgrade pip - pip install setuptools wheel + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download build artifacts + uses: actions/download-artifact@v2 + with: + name: build-artifacts - - name: Build package - run: python setup.py sdist bdist_wheel - - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@v1.8.14 with: From b2a7e0cddc55ced7d33858a4445e1c58f2321f35 Mon Sep 17 00:00:00 2001 From: cenevan <92879012+cenevan@users.noreply.github.com> Date: Fri, 24 May 2024 10:42:56 -0700 Subject: [PATCH 12/36] test4 --- .github/workflows/publish-package.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index c87c9c8..ebb7cf4 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -35,10 +35,11 @@ jobs: - name: Build package run: python setup.py sdist bdist_wheel - - name: Download build artifacts - uses: actions/download-artifact@v2 + - name: Upload build artifacts + uses: actions/upload-artifact@v2 with: name: build-artifacts + path: ./build publish: needs: [Timestamp, build] From ac30a43fcc14a9a64778f8e745e219bfb1820158 Mon Sep 17 00:00:00 2001 From: cenevan <92879012+cenevan@users.noreply.github.com> Date: Fri, 24 May 2024 10:56:59 -0700 Subject: [PATCH 13/36] test5 --- .github/workflows/publish-package.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index ebb7cf4..faf8e40 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -38,7 +38,7 @@ jobs: - name: Upload build artifacts uses: actions/upload-artifact@v2 with: - name: build-artifacts + name: dist path: ./build publish: @@ -52,7 +52,12 @@ jobs: - name: Download build artifacts uses: actions/download-artifact@v2 with: - name: build-artifacts + name: dist + path: dist + + - name: Change working directory + run: cd dist + shell: bash - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@v1.8.14 From 88a910b06737c4a5beca6fb535754e404c280c90 Mon Sep 17 00:00:00 2001 From: cenevan <92879012+cenevan@users.noreply.github.com> Date: Fri, 24 May 2024 11:28:12 -0700 Subject: [PATCH 14/36] update version final --- .github/workflows/publish-package.yml | 29 ++++++++++++++------------- setup.py | 2 +- update_version.py | 2 -- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index faf8e40..cec5ada 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -35,12 +35,6 @@ jobs: - name: Build package run: python setup.py sdist bdist_wheel - - name: Upload build artifacts - uses: actions/upload-artifact@v2 - with: - name: dist - path: ./build - publish: needs: [Timestamp, build] runs-on: ubuntu-latest @@ -49,16 +43,23 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Download build artifacts - uses: actions/download-artifact@v2 + - name: Set up Python 3.12 + uses: actions/setup-python@v5 with: - name: dist - path: dist - - - name: Change working directory - run: cd dist - shell: bash + python-version: "3.12" + + - name: Update version + run: python update_version.py + - name: Install dependencies + run: | + pip install -r requirements.txt + python -m pip install --upgrade pip + pip install setuptools wheel + + - name: Build package + run: python setup.py sdist bdist_wheel + - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@v1.8.14 with: diff --git a/setup.py b/setup.py index a129dda..490c175 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='story_protocol_python_sdk', - version='0.2.3', + version='0.2.2', packages=find_packages(where='src', exclude=["tests"]), package_dir={'': 'src'}, install_requires=[ diff --git a/update_version.py b/update_version.py index 97d86bb..033e1d7 100644 --- a/update_version.py +++ b/update_version.py @@ -12,5 +12,3 @@ with open('setup.py', 'w') as f: f.write(re.sub(r"version='(\d+\.\d+\.\d+)'", f"version='{new_version}'", setup_py)) -with open('your_package/version.py', 'w') as f: - f.write(f"__version__ = '{new_version}'") \ No newline at end of file From 54dc098a8849d5b1f90e932d613dacb95c544002 Mon Sep 17 00:00:00 2001 From: cenevan <92879012+cenevan@users.noreply.github.com> Date: Fri, 24 May 2024 11:30:15 -0700 Subject: [PATCH 15/36] update version final 1 --- .github/workflows/publish-package.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index cec5ada..ad8e08f 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -47,15 +47,15 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.12" - - - name: Update version - run: python update_version.py - name: Install dependencies run: | pip install -r requirements.txt python -m pip install --upgrade pip pip install setuptools wheel + + - name: Update version + run: python update_version.py - name: Build package run: python setup.py sdist bdist_wheel From 9fc25d217cffe01ed9bd1819aa6ab2c1b8521cad Mon Sep 17 00:00:00 2001 From: cenevan <92879012+cenevan@users.noreply.github.com> Date: Fri, 24 May 2024 11:50:10 -0700 Subject: [PATCH 16/36] auto push 1 --- .github/workflows/publish-package.yml | 13 +++++++++++++ setup.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index ad8e08f..723a3cf 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -56,6 +56,19 @@ jobs: - name: Update version run: python update_version.py + + - name: Commit version change + run: | + git add setup.py + git config --global user.name 'GitHub Actions Bot' + git config --global user.email 'actions@github.com' + git commit -m "Update version" + + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: main - name: Build package run: python setup.py sdist bdist_wheel diff --git a/setup.py b/setup.py index 490c175..a129dda 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='story_protocol_python_sdk', - version='0.2.2', + version='0.2.3', packages=find_packages(where='src', exclude=["tests"]), package_dir={'': 'src'}, install_requires=[ From 1c5627c899762dfc9d73240106854e6c9ac128a9 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Fri, 24 May 2024 18:51:25 +0000 Subject: [PATCH 17/36] Update version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a129dda..158f9ed 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='story_protocol_python_sdk', - version='0.2.3', + version='0.2.4', packages=find_packages(where='src', exclude=["tests"]), package_dir={'': 'src'}, install_requires=[ From 099bc8d3a9eda1c73078b70354c0b30cb9d59b6f Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Fri, 24 May 2024 19:01:51 +0000 Subject: [PATCH 18/36] Update version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 158f9ed..1ca6270 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='story_protocol_python_sdk', - version='0.2.4', + version='0.2.5', packages=find_packages(where='src', exclude=["tests"]), package_dir={'': 'src'}, install_requires=[ From eec9c012d838e16b9d2a96b178e81a4acb445a76 Mon Sep 17 00:00:00 2001 From: cenevan <92879012+cenevan@users.noreply.github.com> Date: Fri, 24 May 2024 12:10:49 -0700 Subject: [PATCH 19/36] fix update version --- update_version.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/update_version.py b/update_version.py index 033e1d7..50da9e3 100644 --- a/update_version.py +++ b/update_version.py @@ -6,7 +6,20 @@ version = re.search(r"version='(\d+\.\d+\.\d+)'", setup_py).group(1) major, minor, patch = map(int, version.split('.')) -patch += 1 + +if minor == 9: + if patch == 9: + major += 1 + minor = 0 + patch = 0 + else: + patch += 1 +elif patch == 9: + patch = 0 + minor += 1 +else: + patch += 1 + new_version = f"{major}.{minor}.{patch}" with open('setup.py', 'w') as f: From 999adaed0e77f53521eb5155407fef0f458e3cf0 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Fri, 24 May 2024 19:12:03 +0000 Subject: [PATCH 20/36] Update version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1ca6270..88e503a 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='story_protocol_python_sdk', - version='0.2.5', + version='0.2.6', packages=find_packages(where='src', exclude=["tests"]), package_dir={'': 'src'}, install_requires=[ From 7ebcdd300e05fd9ad09602c3e3fcedf7bcd7c625 Mon Sep 17 00:00:00 2001 From: cenevan <92879012+cenevan@users.noreply.github.com> Date: Fri, 24 May 2024 14:17:28 -0700 Subject: [PATCH 21/36] add linting --- .github/workflows/publish-package.yml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 723a3cf..f6369a7 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -9,9 +9,31 @@ on: jobs: Timestamp: uses: storyprotocol/gha-workflows/.github/workflows/reusable-timestamp.yml@main + + lint: + needs: Timestamp + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 + + - name: Run flake8 + run: | + flake8 . build: - needs: [Timestamp] + needs: [Timestamp, lint] runs-on: ubuntu-latest strategy: matrix: @@ -36,7 +58,7 @@ jobs: run: python setup.py sdist bdist_wheel publish: - needs: [Timestamp, build] + needs: [Timestamp, build, lint] runs-on: ubuntu-latest steps: From eba934c02df154cd81caa9908d532da9d6f4af5e Mon Sep 17 00:00:00 2001 From: cenevan <92879012+cenevan@users.noreply.github.com> Date: Fri, 24 May 2024 14:32:10 -0700 Subject: [PATCH 22/36] add flake file --- .flake8 | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .flake8 diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..c39677e --- /dev/null +++ b/.flake8 @@ -0,0 +1,2 @@ +[flake8] +ignore = W, E, F \ No newline at end of file From 4bfca141c65f3c157de7bf8f9e81917dfbe5f897 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Fri, 24 May 2024 21:33:39 +0000 Subject: [PATCH 23/36] Update version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 88e503a..a6c2e37 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='story_protocol_python_sdk', - version='0.2.6', + version='0.2.7', packages=find_packages(where='src', exclude=["tests"]), package_dir={'': 'src'}, install_requires=[ From 67abaedb1b7ce7816cc8ae93d35839f62c8e97e7 Mon Sep 17 00:00:00 2001 From: cenevan <92879012+cenevan@users.noreply.github.com> Date: Fri, 24 May 2024 15:45:07 -0700 Subject: [PATCH 24/36] flake config change --- .flake8 | 1 + 1 file changed, 1 insertion(+) diff --git a/.flake8 b/.flake8 index c39677e..a75cff8 100644 --- a/.flake8 +++ b/.flake8 @@ -1,2 +1,3 @@ [flake8] +exclude = abi ignore = W, E, F \ No newline at end of file From fc536729181fd1a19de82c6a3595a16d37b6d4a3 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Fri, 24 May 2024 22:46:32 +0000 Subject: [PATCH 25/36] Update version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a6c2e37..a3bf963 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='story_protocol_python_sdk', - version='0.2.7', + version='0.2.8', packages=find_packages(where='src', exclude=["tests"]), package_dir={'': 'src'}, install_requires=[ From 590f3e2e1d05bab002eb5ff75c79608e1123c13c Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Fri, 24 May 2024 23:12:30 +0000 Subject: [PATCH 26/36] Update version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a3bf963..765998a 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='story_protocol_python_sdk', - version='0.2.8', + version='0.2.9', packages=find_packages(where='src', exclude=["tests"]), package_dir={'': 'src'}, install_requires=[ From f2b5f67e27876237258af1305f015472984345db Mon Sep 17 00:00:00 2001 From: cenevan <92879012+cenevan@users.noreply.github.com> Date: Fri, 24 May 2024 16:44:13 -0700 Subject: [PATCH 27/36] version change --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 765998a..9570567 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='story_protocol_python_sdk', - version='0.2.9', + version='0.2.0', packages=find_packages(where='src', exclude=["tests"]), package_dir={'': 'src'}, install_requires=[ From 8d3878cc375636566c5256f96d90351a52f3e453 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Fri, 24 May 2024 23:45:37 +0000 Subject: [PATCH 28/36] Update version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 9570567..44c04b6 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='story_protocol_python_sdk', - version='0.2.0', + version='0.2.1', packages=find_packages(where='src', exclude=["tests"]), package_dir={'': 'src'}, install_requires=[ From f895cf689146fd30c1a8d2cdcb3ffdef5fa7f7ff Mon Sep 17 00:00:00 2001 From: cenevan <92879012+cenevan@users.noreply.github.com> Date: Wed, 29 May 2024 11:37:29 -0700 Subject: [PATCH 29/36] version control --- .github/workflows/publish-package.yml | 25 ++++++++++++++++++++----- update_version.py => update_major.py | 15 +++------------ update_minor.py | 17 +++++++++++++++++ update_patch.py | 16 ++++++++++++++++ 4 files changed, 56 insertions(+), 17 deletions(-) rename update_version.py => update_major.py (67%) create mode 100644 update_minor.py create mode 100644 update_patch.py diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index f6369a7..ded185d 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -1,10 +1,16 @@ name: publish package to PyPi on: - push: - branches: - - main workflow_dispatch: + inputs: + version_type: + type: choice + description: version to be published + options: + - major + - minor + - patch + jobs: Timestamp: @@ -76,8 +82,17 @@ jobs: python -m pip install --upgrade pip pip install setuptools wheel - - name: Update version - run: python update_version.py + - name: Run major script + if: ${{ github.event.inputs.version_type == 'major' }} + run: python update_major.py + + - name: Run minor script + if: ${{ github.event.inputs.version_type == 'minor' }} + run: python update_minor.py + + - name: Run patch script + if: ${{ github.event.inputs.version_type == 'patch' }} + run: python update_patch.py - name: Commit version change run: | diff --git a/update_version.py b/update_major.py similarity index 67% rename from update_version.py rename to update_major.py index 50da9e3..d903afb 100644 --- a/update_version.py +++ b/update_major.py @@ -7,18 +7,9 @@ version = re.search(r"version='(\d+\.\d+\.\d+)'", setup_py).group(1) major, minor, patch = map(int, version.split('.')) -if minor == 9: - if patch == 9: - major += 1 - minor = 0 - patch = 0 - else: - patch += 1 -elif patch == 9: - patch = 0 - minor += 1 -else: - patch += 1 +major += 1 +minor = 0 +patch = 0 new_version = f"{major}.{minor}.{patch}" diff --git a/update_minor.py b/update_minor.py new file mode 100644 index 0000000..1b64183 --- /dev/null +++ b/update_minor.py @@ -0,0 +1,17 @@ +import re +from setuptools import setup + +with open('setup.py', 'r') as f: + setup_py = f.read() + +version = re.search(r"version='(\d+\.\d+\.\d+)'", setup_py).group(1) +major, minor, patch = map(int, version.split('.')) + +minor += 1 +patch = 0 + +new_version = f"{major}.{minor}.{patch}" + +with open('setup.py', 'w') as f: + f.write(re.sub(r"version='(\d+\.\d+\.\d+)'", f"version='{new_version}'", setup_py)) + diff --git a/update_patch.py b/update_patch.py new file mode 100644 index 0000000..c0354fc --- /dev/null +++ b/update_patch.py @@ -0,0 +1,16 @@ +import re +from setuptools import setup + +with open('setup.py', 'r') as f: + setup_py = f.read() + +version = re.search(r"version='(\d+\.\d+\.\d+)'", setup_py).group(1) +major, minor, patch = map(int, version.split('.')) + +patch += 1 + +new_version = f"{major}.{minor}.{patch}" + +with open('setup.py', 'w') as f: + f.write(re.sub(r"version='(\d+\.\d+\.\d+)'", f"version='{new_version}'", setup_py)) + From 62abc8c7a2746d1e4e7033ffdbc3cd740646683f Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Wed, 29 May 2024 18:40:26 +0000 Subject: [PATCH 30/36] Update version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 44c04b6..490c175 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='story_protocol_python_sdk', - version='0.2.1', + version='0.2.2', packages=find_packages(where='src', exclude=["tests"]), package_dir={'': 'src'}, install_requires=[ From 4f6e095b165f62326d244914bb1fba21de611811 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Wed, 29 May 2024 18:54:16 +0000 Subject: [PATCH 31/36] Update version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 490c175..d5cb19c 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='story_protocol_python_sdk', - version='0.2.2', + version='1.0.0', packages=find_packages(where='src', exclude=["tests"]), package_dir={'': 'src'}, install_requires=[ From 878e1d008754877e6dcbbea6ff023bac96b527bf Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Wed, 29 May 2024 18:57:12 +0000 Subject: [PATCH 32/36] Update version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d5cb19c..eab4485 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='story_protocol_python_sdk', - version='1.0.0', + version='2.0.0', packages=find_packages(where='src', exclude=["tests"]), package_dir={'': 'src'}, install_requires=[ From af1cd66ff426393a37cde3b2ee35b91ba58c7118 Mon Sep 17 00:00:00 2001 From: cenevan <92879012+cenevan@users.noreply.github.com> Date: Wed, 29 May 2024 13:31:35 -0700 Subject: [PATCH 33/36] version change --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index eab4485..cee4ada 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='story_protocol_python_sdk', - version='2.0.0', + version='0.1.5', packages=find_packages(where='src', exclude=["tests"]), package_dir={'': 'src'}, install_requires=[ From 95eb48db1ad2e7a1ed377872469e4b8f5e21f81f Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Wed, 29 May 2024 20:33:14 +0000 Subject: [PATCH 34/36] Update version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index cee4ada..ec8443b 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='story_protocol_python_sdk', - version='0.1.5', + version='0.1.6', packages=find_packages(where='src', exclude=["tests"]), package_dir={'': 'src'}, install_requires=[ From 4814963abdc19b82ec1556712024b2a777ec3578 Mon Sep 17 00:00:00 2001 From: cenevan <92879012+cenevan@users.noreply.github.com> Date: Wed, 29 May 2024 14:36:17 -0700 Subject: [PATCH 35/36] consolidate version files --- .github/workflows/publish-package.yml | 16 ++++------------ update_minor.py | 17 ----------------- update_patch.py | 16 ---------------- update_major.py => update_version.py | 16 ++++++++++++---- 4 files changed, 16 insertions(+), 49 deletions(-) delete mode 100644 update_minor.py delete mode 100644 update_patch.py rename update_major.py => update_version.py (61%) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index ded185d..18d0807 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -11,7 +11,6 @@ on: - minor - patch - jobs: Timestamp: uses: storyprotocol/gha-workflows/.github/workflows/reusable-timestamp.yml@main @@ -82,17 +81,10 @@ jobs: python -m pip install --upgrade pip pip install setuptools wheel - - name: Run major script - if: ${{ github.event.inputs.version_type == 'major' }} - run: python update_major.py - - - name: Run minor script - if: ${{ github.event.inputs.version_type == 'minor' }} - run: python update_minor.py - - - name: Run patch script - if: ${{ github.event.inputs.version_type == 'patch' }} - run: python update_patch.py + - name: Change version number + env: + VERSION_TYPE: ${{ github.event.inputs.version_type }} + run: python update_version.py - name: Commit version change run: | diff --git a/update_minor.py b/update_minor.py deleted file mode 100644 index 1b64183..0000000 --- a/update_minor.py +++ /dev/null @@ -1,17 +0,0 @@ -import re -from setuptools import setup - -with open('setup.py', 'r') as f: - setup_py = f.read() - -version = re.search(r"version='(\d+\.\d+\.\d+)'", setup_py).group(1) -major, minor, patch = map(int, version.split('.')) - -minor += 1 -patch = 0 - -new_version = f"{major}.{minor}.{patch}" - -with open('setup.py', 'w') as f: - f.write(re.sub(r"version='(\d+\.\d+\.\d+)'", f"version='{new_version}'", setup_py)) - diff --git a/update_patch.py b/update_patch.py deleted file mode 100644 index c0354fc..0000000 --- a/update_patch.py +++ /dev/null @@ -1,16 +0,0 @@ -import re -from setuptools import setup - -with open('setup.py', 'r') as f: - setup_py = f.read() - -version = re.search(r"version='(\d+\.\d+\.\d+)'", setup_py).group(1) -major, minor, patch = map(int, version.split('.')) - -patch += 1 - -new_version = f"{major}.{minor}.{patch}" - -with open('setup.py', 'w') as f: - f.write(re.sub(r"version='(\d+\.\d+\.\d+)'", f"version='{new_version}'", setup_py)) - diff --git a/update_major.py b/update_version.py similarity index 61% rename from update_major.py rename to update_version.py index d903afb..c4a4b27 100644 --- a/update_major.py +++ b/update_version.py @@ -1,15 +1,23 @@ -import re +import re, os from setuptools import setup +version_type = os.getenv('VERSION_TYPE') + with open('setup.py', 'r') as f: setup_py = f.read() version = re.search(r"version='(\d+\.\d+\.\d+)'", setup_py).group(1) major, minor, patch = map(int, version.split('.')) -major += 1 -minor = 0 -patch = 0 +if version_type == 'major': + major += 1 + minor = 0 + patch = 0 +elif version_type == 'minor': + minor += 1 + patch = 0 +elif version_type == 'patch': + patch += 1 new_version = f"{major}.{minor}.{patch}" From dee6f8af244cddb25588140df65f4a401f223fcc Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Wed, 29 May 2024 21:38:19 +0000 Subject: [PATCH 36/36] Update version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ec8443b..10575e2 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='story_protocol_python_sdk', - version='0.1.6', + version='0.1.7', packages=find_packages(where='src', exclude=["tests"]), package_dir={'': 'src'}, install_requires=[