Skip to content

Commit

Permalink
Fix release tool
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonMa0012 committed Dec 2, 2024
1 parent f03c0ab commit 75975d9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 24 deletions.
Binary file modified ReleaseTools/Release.exe
Binary file not shown.
34 changes: 18 additions & 16 deletions ReleaseTools/Release.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
if len(sys.argv) > 1:
mooatoon_root_path = sys.argv[1]

engine_version = "5.3"
engine_version = "5.5"
if len(sys.argv) > 2:
engine_version = sys.argv[2]

project_branch_name = "5.3_MooaToonProject"
project_branch_name = "5.5_MooaToonProject"
if len(sys.argv) > 3:
project_branch_name = sys.argv[3]

# Default Input
argv = [
'--Release'
'--Reupload'
]
if len(sys.argv) > 4:
argv = sys.argv[4:]
Expand Down Expand Up @@ -123,8 +123,11 @@ def async_run(args):
file_paths.append(file_path)

last_release_info = None
last_draft_info = None
for release in ghr.get_releases(repo_name):
if (not release['draft']) and (release['tag_name'].startswith(engine_version)):
if release['draft']:
last_draft_info = release
elif release['tag_name'].startswith(engine_version):
last_release_info = release
break

Expand All @@ -147,17 +150,16 @@ def async_run(args):

if '--Reupload' in argv:
print("======Reupload======")
current_release_info = ghr.get_release(repo_name, release_name)
tag_name = current_release_info['tag_name']

# 仅上传失败的文件
for asset in current_release_info['assets']:
for file_path in file_paths:
if file_path.endswith(asset['name']):
file_paths.remove(file_path)

ghr.gh_asset_upload(repo_name, tag_name, file_paths)
ghr.gh_release_publish(repo_name, tag_name)

if last_draft_info is not None:
# 仅上传失败的文件
for asset in last_draft_info['assets']:
for file_path in file_paths:
if file_path.endswith(asset['name']):
file_paths.remove(file_path)

ghr.gh_asset_upload(repo_name, last_draft_info['tag_name'], file_paths)
ghr.gh_release_publish(repo_name, last_draft_info['tag_name'])
else:
print("\nThere is no draft!\n")

input("\nPress Enter to continue...")
10 changes: 2 additions & 8 deletions ReleaseTools/Release.spec
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# -*- mode: python ; coding: utf-8 -*-


block_cipher = None


a = Analysis(
['Release.py'],
pathex=[],
Expand All @@ -14,18 +11,15 @@ a = Analysis(
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
pyz = PYZ(a.pure)

exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='Release',
Expand Down

0 comments on commit 75975d9

Please sign in to comment.