From 9e49101e5c49a7ca4fd57461156d7796f0e912ac Mon Sep 17 00:00:00 2001 From: root <1561515308@qq.com> Date: Sat, 30 Mar 2024 10:56:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/continuous-integration-workflow.yml | 8 ++++---- pmpt/util.py | 8 +++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml index bab5465..5eef6fa 100644 --- a/.github/workflows/continuous-integration-workflow.yml +++ b/.github/workflows/continuous-integration-workflow.yml @@ -2,13 +2,13 @@ # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries # action的名称 -name: Upload Python Package gotwo +name: Upload Python Package on: # 当master分支有push时,触发action push: - pull_request: - + tags: + - v** jobs: deploy: name: publish python package to PYPI @@ -25,7 +25,7 @@ jobs: python -m pip install --upgrade pip python -m pip install wheel twine python -m pip install -r requirements.txt - echo $GITHUB_RUN_ID + # - name: Test Code # run: | # ./test.sh diff --git a/pmpt/util.py b/pmpt/util.py index 554538c..1d8d369 100644 --- a/pmpt/util.py +++ b/pmpt/util.py @@ -8,13 +8,11 @@ from platformdirs import PlatformDirs dirs = PlatformDirs("PMPT", "MoYan") IndexList = [] -def getVer(): - s = os.popen('git describe --tags').read() - print(s) - baseVar = s.split('v')[1].split('-')[0] + '_' + os.environ.get('GITHUB_RUN_ID', str(int(time.time()))[:6]) +def getVer(baseVar): + baseVar = baseVar + '.' + os.environ.get('GITHUB_RUN_ID', str(int(time.time()))[:6]) return baseVar -__version__ = getVer() +__version__ = getVer('1.0.1') def init(): os.makedirs(dirs.user_data_dir,exist_ok=True) os.makedirs(os.path.join(dirs.user_data_dir,'Index'),exist_ok=True)