Upload mksnapshot to releases

This commit is contained in:
Cheng Zhao 2015-05-06 09:17:40 +08:00
parent 6c5429c7f0
commit 1817ddc18a
2 changed files with 19 additions and 14 deletions

View file

@ -79,7 +79,8 @@ def main():
force_build() force_build()
create_symbols() create_symbols()
copy_binaries() copy_binaries()
copy_chromedriver() copy_chrome_binary('chromedriver')
copy_chrome_binary('mksnapshot')
copy_license() copy_license()
if PLATFORM == 'linux': if PLATFORM == 'linux':
@ -88,7 +89,8 @@ def main():
create_version() create_version()
create_dist_zip() create_dist_zip()
create_chromedriver_zip() create_chrome_binary_zip('chromedriver', get_chromedriver_version())
create_chrome_binary_zip('mksnapshot', ATOM_SHELL_VERSION)
create_symbols_zip() create_symbols_zip()
@ -107,13 +109,11 @@ def copy_binaries():
symlinks=True) symlinks=True)
def copy_chromedriver(): def copy_chrome_binary(binary):
if PLATFORM == 'win32': if PLATFORM == 'win32':
chromedriver = 'chromedriver.exe' binary += '.exe'
else: src = os.path.join(CHROMIUM_DIR, binary)
chromedriver = 'chromedriver' dest = os.path.join(DIST_DIR, binary)
src = os.path.join(CHROMIUM_DIR, chromedriver)
dest = os.path.join(DIST_DIR, chromedriver)
# Copy file and keep the executable bit. # Copy file and keep the executable bit.
shutil.copyfile(src, dest) shutil.copyfile(src, dest)
@ -170,17 +170,17 @@ def create_dist_zip():
make_zip(zip_file, files, dirs) make_zip(zip_file, files, dirs)
def create_chromedriver_zip(): def create_chrome_binary_zip(binary, version):
dist_name = 'chromedriver-{0}-{1}-{2}.zip'.format(get_chromedriver_version(), dist_name = '{0}-{1}-{2}-{3}.zip'.format(binary, version, PLATFORM,
PLATFORM, get_target_arch()) get_target_arch())
zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name) zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)
with scoped_cwd(DIST_DIR): with scoped_cwd(DIST_DIR):
files = ['LICENSE'] files = ['LICENSE']
if PLATFORM == 'win32': if PLATFORM == 'win32':
files += ['chromedriver.exe'] files += [binary + '.exe']
else: else:
files += ['chromedriver'] files += [binary]
make_zip(zip_file, files, []) make_zip(zip_file, files, [])

View file

@ -34,6 +34,9 @@ SYMBOLS_NAME = '{0}-{1}-{2}-{3}-symbols.zip'.format(PROJECT_NAME,
CHROMEDRIVER_NAME = 'chromedriver-{0}-{1}-{2}.zip'.format(CHROMEDRIVER_VERSION, CHROMEDRIVER_NAME = 'chromedriver-{0}-{1}-{2}.zip'.format(CHROMEDRIVER_VERSION,
PLATFORM, PLATFORM,
get_target_arch()) get_target_arch())
MKSNAPSHOT_NAME = 'mksnapshot-{0}-{1}-{2}.zip'.format(ATOM_SHELL_VERSION,
PLATFORM,
get_target_arch())
def main(): def main():
@ -74,10 +77,12 @@ def main():
upload_atom_shell(github, release_id, os.path.join(DIST_DIR, DIST_NAME)) upload_atom_shell(github, release_id, os.path.join(DIST_DIR, DIST_NAME))
upload_atom_shell(github, release_id, os.path.join(DIST_DIR, SYMBOLS_NAME)) upload_atom_shell(github, release_id, os.path.join(DIST_DIR, SYMBOLS_NAME))
# Upload chromedriver for minor version update. # Upload chromedriver and mksnapshot for minor version update.
if parse_version(args.version)[2] == '0': if parse_version(args.version)[2] == '0':
upload_atom_shell(github, release_id, upload_atom_shell(github, release_id,
os.path.join(DIST_DIR, CHROMEDRIVER_NAME)) os.path.join(DIST_DIR, CHROMEDRIVER_NAME))
upload_atom_shell(github, release_id,
os.path.join(DIST_DIR, MKSNAPSHOT_NAME))
if PLATFORM == 'win32': if PLATFORM == 'win32':
# Upload PDBs to Windows symbol server. # Upload PDBs to Windows symbol server.