更新版本号

This commit is contained in:
root 2024-03-30 10:56:51 +08:00
parent f512220564
commit 9e49101e5c
2 changed files with 7 additions and 9 deletions

View File

@ -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 # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
# action的名称 # action的名称
name: Upload Python Package gotwo name: Upload Python Package
on: on:
# 当master分支有push时触发action # 当master分支有push时触发action
push: push:
pull_request: tags:
- v**
jobs: jobs:
deploy: deploy:
name: publish python package to PYPI name: publish python package to PYPI
@ -25,7 +25,7 @@ jobs:
python -m pip install --upgrade pip python -m pip install --upgrade pip
python -m pip install wheel twine python -m pip install wheel twine
python -m pip install -r requirements.txt python -m pip install -r requirements.txt
echo $GITHUB_RUN_ID
# - name: Test Code # - name: Test Code
# run: | # run: |
# ./test.sh # ./test.sh

View File

@ -8,13 +8,11 @@ from platformdirs import PlatformDirs
dirs = PlatformDirs("PMPT", "MoYan") dirs = PlatformDirs("PMPT", "MoYan")
IndexList = [] IndexList = []
def getVer(): def getVer(baseVar):
s = os.popen('git describe --tags').read() baseVar = baseVar + '.' + os.environ.get('GITHUB_RUN_ID', str(int(time.time()))[:6])
print(s)
baseVar = s.split('v')[1].split('-')[0] + '_' + os.environ.get('GITHUB_RUN_ID', str(int(time.time()))[:6])
return baseVar return baseVar
__version__ = getVer() __version__ = getVer('1.0.1')
def init(): def init():
os.makedirs(dirs.user_data_dir,exist_ok=True) os.makedirs(dirs.user_data_dir,exist_ok=True)
os.makedirs(os.path.join(dirs.user_data_dir,'Index'),exist_ok=True) os.makedirs(os.path.join(dirs.user_data_dir,'Index'),exist_ok=True)