Update Deploy.py

Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
Loren Eteval
2024-02-29 22:19:40 +08:00
parent 0a6f1b0b3a
commit 31f7ddd929
+11 -20
View File
@@ -182,7 +182,7 @@ def main():
)
# Sleep for a while for any running nuitka tasks
time.sleep(2)
time.sleep(5)
if PLATFORM == 'Windows':
foldername = (
@@ -209,43 +209,31 @@ def main():
logger=logger,
)
elif PLATFORM == 'Darwin':
dmgDir = ROOT_DIR / 'dmg'
appDir = ROOT_DIR / 'dmg' / 'app'
appDir = ROOT_DIR / 'app'
try:
os.mkdir(dmgDir)
except FileExistsError:
shutil.rmtree(appDir)
except FileNotFoundError:
pass
except Exception:
# Any non-exit exceptions
raise
try:
os.mkdir(appDir)
except FileExistsError:
pass
except Exception:
# Any non-exit exceptions
raise
try:
shutil.rmtree(appDir / 'Furious-GUI.app')
except FileNotFoundError:
pass
except Exception:
raise
shutil.copytree(
ROOT_DIR / DEPLOY_DIR_NAME / 'Furious-GUI.app',
appDir / 'Furious-GUI.app',
)
try:
logger.info('generate dmg')
logger.info('generating dmg')
dmgfile = f'{ARTIFACT_NAME}.dmg'
output = f'{ARTIFACT_NAME}.dmg'
result = runExternalCommand(
(
@@ -258,7 +246,7 @@ def main():
f'--icon \"Furious-GUI.app\" 175 120 '
f'--hide-extension \"Furious-GUI.app\" '
f'--app-drop-link 425 120 '
f'\"{ROOT_DIR / dmgfile}\" '
f'\"{ROOT_DIR / output}\" '
f'\"{appDir}\"'
),
stdout=subprocess.PIPE,
@@ -287,7 +275,10 @@ def main():
flush=True,
)
logger.info(f'generate dmg success: {dmgfile}')
logger.info(f'generate dmg success: {output}')
# Sleep for a while for any running tasks
time.sleep(5)
if __name__ == '__main__':