Run clean + debug on branch switch for publish

This commit is contained in:
Kovid Goyal
2024-05-08 21:28:22 +05:30
parent 5cfa139189
commit c50e38a080

View File

@@ -522,13 +522,13 @@ def change_to_git_master() -> Generator[None, None, None]:
if branch_before != 'master': if branch_before != 'master':
subprocess.check_call(['git', 'switch', 'master']) subprocess.check_call(['git', 'switch', 'master'])
remove_pycache_only_folders() remove_pycache_only_folders()
subprocess.check_call(['make', 'debug']) subprocess.check_call(['make', 'clean', 'debug'])
try: try:
yield yield
finally: finally:
if branch_before != 'master': if branch_before != 'master':
subprocess.check_call(['git', 'switch', branch_before]) subprocess.check_call(['git', 'switch', branch_before])
subprocess.check_call(['make', 'debug']) subprocess.check_call(['make', 'clean', 'debug'])
finally: finally:
if stash_ref_before != safe_read('.git/refs/stash'): if stash_ref_before != safe_read('.git/refs/stash'):
subprocess.check_call(['git', 'stash', 'pop']) subprocess.check_call(['git', 'stash', 'pop'])
@@ -572,7 +572,7 @@ def main() -> None:
with change_to_git_master(): with change_to_git_master():
building_nightly = True building_nightly = True
exec_actions(NIGHTLY_ACTIONS, args) exec_actions(NIGHTLY_ACTIONS, args)
subprocess.run(['make', 'debug']) subprocess.run(['make', 'clean', 'debug'])
return return
require_git_master() require_git_master()
if args.action == 'all': if args.action == 'all':