Skip to content

Commit

Permalink
kk
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Jul 24, 2022
1 parent 860825a commit 35a0440
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
- name: auto version
run:
python -m pip install PyGithub
- name: out version
run:
python run_tags_add.py
# 构建和发布
- name: Install pypa/build
Expand Down
23 changes: 12 additions & 11 deletions run_tags_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def 版本号从大小写排序(tags):
def main():
GITHUB_REPOSITORY = os.environ.get('GITHUB_REPOSITORY')
INPUT_TOKEN = os.environ.get('GITHUB_TOKEN')
# GITHUB_REPOSITORY = 'duolabmeng6/pyefun'
g = Github(INPUT_TOKEN)
repo = g.get_repo(GITHUB_REPOSITORY)
print("tags number", repo.get_tags().totalCount)
Expand Down Expand Up @@ -79,17 +80,17 @@ def main():

# 替换文本内容 __version__ = '1.2.5'
# 打开文件 pyefun/__init__.py
with open("pyefun/__init__.py", "r") as f:
lines = f.readlines()
# 找到版本号的行
for i, line in enumerate(lines):
if '__version__' in line:
# 找到版本号的行
version_line = i
break
# 替换版本号
lines[version_line] = f"__version__ = '{新版本号}'\n"

# with open("pyefun/__init__.py", "r") as f:
# lines = f.readlines()
# # 找到版本号的行
# for i, line in enumerate(lines):
# if '__version__' in line:
# # 找到版本号的行
# version_line = i
# break
# # 替换版本号
# lines[version_line] = f"__version__ = '{新版本号}'\n"
#



Expand Down

0 comments on commit 35a0440

Please sign in to comment.