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
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

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