Use a safer bypy artifact transition scheme

This commit is contained in:
Kovid Goyal 2021-11-24 13:45:39 +05:30
parent c996912602
commit c904e934e1
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -20,9 +20,14 @@ if flags == '1': # A branch checkout
prev_branch, cur_branch = list(map(get_branch_name, (prev_rev, current_rev))) prev_branch, cur_branch = list(map(get_branch_name, (prev_rev, current_rev)))
if {prev_branch, cur_branch} == {'master', 'qt6'}: if {prev_branch, cur_branch} == {'master', 'qt6'}:
os.rename('bypy/b/other-b', 'bypy/c') b = 'qt6' if cur_branch == 'qt6' else 'qt5'
os.rename('bypy/b', 'bypy/c/other-b') for x in os.listdir(f'bypy/b/{b}'):
os.rename('bypy/c', 'bypy/b') link = f'bypy/b/{x}'
try:
os.remove(link)
except FileNotFoundError:
pass
os.symlink(f'{b}/{x}', link)
subprocess.check_call('./setup.py build --clean'.split()) subprocess.check_call('./setup.py build --clean'.split())
subprocess.check_call('./setup.py gui --clean'.split()) subprocess.check_call('./setup.py gui --clean'.split())
subprocess.check_call('./setup.py build'.split()) subprocess.check_call('./setup.py build'.split())