From 9c35abc6e2cfd82f5e0f4160feed5b20ddf0d09c Mon Sep 17 00:00:00 2001 From: snowy Date: Sun, 18 Aug 2024 21:45:11 +0800 Subject: [PATCH] :bookmark: liteyuki 6.3.6 --- .github/workflows/pypi-publish.yml | 12 ++++++++++++ liteyuki/__init__.py | 5 ++--- liteyuki/version.py | 21 --------------------- pyproject.toml | 7 +++---- 4 files changed, 17 insertions(+), 28 deletions(-) delete mode 100644 liteyuki/version.py diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 38c84e50..147b28a9 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -20,5 +20,17 @@ jobs: - uses: pdm-project/setup-pdm@v3 + - name: Check version + run: | + current_version=$(pdm show --json | jq -r '.version') + echo "Current version: $current_version" + package_name=$(pdm show --json | jq -r '.name') + last_version=$(curl -s https://pypi.org/pypi/$package_name/json | jq -r '.info.version') + echo "Last version on PyPI: $last_version" + if [ "$current_version" == "$last_version" ]; then + echo "Version has not been updated." + exit 1 + fi + - name: Publish package distributions to PyPI run: pdm publish \ No newline at end of file diff --git a/liteyuki/__init__.py b/liteyuki/__init__.py index 7736ef02..47c53370 100644 --- a/liteyuki/__init__.py +++ b/liteyuki/__init__.py @@ -20,8 +20,6 @@ from liteyuki.log import ( logger ) -from liteyuki.version import __version__ - __all__ = [ "LiteyukiBot", @@ -34,7 +32,8 @@ __all__ = [ "load_plugins", "init_log", "logger", - "__version__" ] +__version__ = "6.3.6" + diff --git a/liteyuki/version.py b/liteyuki/version.py deleted file mode 100644 index fc5315ca..00000000 --- a/liteyuki/version.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -""" -Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved - -@Time : 2024/8/18 上午3:49 -@Author : snowykami -@Email : snowykami@outlook.com -@File : version.py.py -@Software: PyCharm -""" -from datetime import datetime - -from pdm.backend.hooks.version import SCMVersion - -__datetime__ = datetime.now().strftime("%Y%m%d%H%M%S") - -__version__ = "6.3.6" - - -def format_version(version: SCMVersion) -> str: - return f"{__version__}.dev{__datetime__}" diff --git a/pyproject.toml b/pyproject.toml index ffc4b13c..56dd0ee7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ Repository = "https://github.com/LiteyukiStudio/LiteyukiBot" [build-system] -requires = ["pdm-backend", "loguru", "pydantic", "PyYAML", "toml", "watchdog"] +requires = ["pdm-backend"] build-backend = "pdm.backend" [tool.pdm.build] @@ -38,6 +38,5 @@ includes = ["liteyuki/", "LICENSE", "README.md"] excludes = ["tests/", "docs/", "src/"] [tool.pdm.version] -source = "scm" -version_format = "liteyuki.version:format_version" -fallback_version = "6.0.0" \ No newline at end of file +source = "file" +path = "liteyuki/__init__.py" \ No newline at end of file