def copy_vcruntime_binaries(): arch = get_target_arch() if arch == "ia32": arch = "x86" subkey = r"SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\\" with _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, subkey + arch, 0, _winreg.KEY_READ | _winreg.KEY_WOW64_32KEY) as key: runtime_version = _winreg.QueryValueEx(key, "Version")[0][1:] version_parts = parse_version(runtime_version) if len(version_parts) > 3: runtime_version = '.'.join(version_parts[0:3]) vs_location = get_vs_location('[15.0,16.0)') crt_dir = os.path.join(vs_location, 'VC', 'Redist', 'MSVC', runtime_version, arch, 'Microsoft.VC141.CRT') dlls = ["msvcp140.dll", "vcruntime140.dll"] # Note: copyfile is used to remove the read-only flag for dll in dlls: shutil.copyfile(os.path.join(crt_dir, dll), os.path.join(DIST_DIR, dll)) TARGET_BINARIES_EXT.append(dll)
def main(): args = parse_args() if not dist_newer_than_head(): run_python_script('create-dist.py') build_version = get_electron_build_version() if not ELECTRON_VERSION.startswith(build_version): error = 'Tag name ({0}) should match build version ({1})\n'.format( ELECTRON_VERSION, build_version) sys.stderr.write(error) sys.stderr.flush() return 1 github = GitHub(auth_token()) releases = github.repos(ELECTRON_REPO).releases.get() tag_exists = False for r in releases: if not r['draft'] and r['tag_name'] == args.version: release = r tag_exists = True break assert tag_exists == args.overwrite, \ 'You have to pass --overwrite to overwrite a published release' if not args.overwrite: release = create_or_get_release_draft(github, releases, args.version, tag_exists) # Upload Electron with GitHub Releases API. upload_electron(github, release, os.path.join(DIST_DIR, DIST_NAME)) upload_electron(github, release, os.path.join(DIST_DIR, SYMBOLS_NAME)) if PLATFORM == 'darwin': upload_electron(github, release, os.path.join(DIST_DIR, 'electron-api.json')) upload_electron(github, release, os.path.join(DIST_DIR, 'electron.d.ts')) upload_electron(github, release, os.path.join(DIST_DIR, DSYM_NAME)) elif PLATFORM == 'win32': upload_electron(github, release, os.path.join(DIST_DIR, PDB_NAME)) # Upload free version of ffmpeg. ffmpeg = get_zip_name('ffmpeg', ELECTRON_VERSION) upload_electron(github, release, os.path.join(DIST_DIR, ffmpeg)) # Upload chromedriver and mksnapshot for minor version update. if parse_version(args.version)[2] == '0': chromedriver = get_zip_name('chromedriver', ELECTRON_VERSION) upload_electron(github, release, os.path.join(DIST_DIR, chromedriver)) mksnapshot = get_zip_name('mksnapshot', ELECTRON_VERSION) upload_electron(github, release, os.path.join(DIST_DIR, mksnapshot)) if PLATFORM == 'win32' and not tag_exists: # Upload PDBs to Windows symbol server. run_python_script('upload-windows-pdb.py') # Upload node headers. run_python_script('create-node-headers.py', '-v', args.version) run_python_script('upload-node-headers.py', '-v', args.version)
def main(): args = parse_args() if not args.publish_release: if not dist_newer_than_head(): create_dist = os.path.join(SOURCE_ROOT, 'script', 'create-dist.py') execute([sys.executable, create_dist]) build_version = get_atom_shell_build_version() if not ATOM_SHELL_VERSION.startswith(build_version): error = 'Tag name ({0}) should match build version ({1})\n'.format( ATOM_SHELL_VERSION, build_version) sys.stderr.write(error) sys.stderr.flush() return 1 github = GitHub(auth_token()) releases = github.repos(ATOM_SHELL_REPO).releases.get() tag_exists = False for release in releases: if not release['draft'] and release['tag_name'] == args.version: tag_exists = True break release = create_or_get_release_draft(github, releases, args.version, tag_exists) if args.publish_release: # Upload the SHASUMS.txt. execute([sys.executable, os.path.join(SOURCE_ROOT, 'script', 'upload-checksums.py'), '-v', ATOM_SHELL_VERSION]) # Upload the index.json. execute([sys.executable, os.path.join(SOURCE_ROOT, 'script', 'upload-index-json.py')]) # Press the publish button. publish_release(github, release['id']) # Do not upload other files when passed "-p". return # Upload atom-shell with GitHub Releases API. upload_atom_shell(github, release, os.path.join(DIST_DIR, DIST_NAME)) upload_atom_shell(github, release, os.path.join(DIST_DIR, SYMBOLS_NAME)) # Upload chromedriver and mksnapshot for minor version update. if parse_version(args.version)[2] == '0': chromedriver = 'chromedriver-{0}-{1}-{2}.zip'.format( get_chromedriver_version(), get_platform_key(), get_target_arch()) upload_atom_shell(github, release, os.path.join(DIST_DIR, chromedriver)) upload_atom_shell(github, release, os.path.join(DIST_DIR, MKSNAPSHOT_NAME)) if PLATFORM == 'win32' and not tag_exists: # Upload node headers. execute([sys.executable, os.path.join(SOURCE_ROOT, 'script', 'upload-node-headers.py'), '-v', args.version])
def main(): args = parse_args() if not dist_newer_than_head(): create_dist = os.path.join(SOURCE_ROOT, 'script', 'create-dist.py') execute([sys.executable, create_dist]) build_version = get_atom_shell_build_version() if not ATOM_SHELL_VERSION.startswith(build_version): error = 'Tag name ({0}) should match build version ({1})\n'.format( ATOM_SHELL_VERSION, build_version) sys.stderr.write(error) sys.stderr.flush() return 1 github = GitHub(auth_token()) release_id = create_or_get_release_draft(github, args.version) if args.publish_release: # Upload the SHASUMS.txt. execute([ sys.executable, os.path.join(SOURCE_ROOT, 'script', 'upload-checksums.py'), '-v', ATOM_SHELL_VERSION ]) # Upload the index.json. execute([ sys.executable, os.path.join(SOURCE_ROOT, 'script', 'upload-index-json.py') ]) # Press the publish button. publish_release(github, release_id) # Do not upload other files when passed "-p". return # Upload atom-shell with GitHub Releases API. 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 chromedriver and mksnapshot for minor version update. if parse_version(args.version)[2] == '0': upload_atom_shell(github, release_id, os.path.join(DIST_DIR, CHROMEDRIVER_NAME)) upload_atom_shell(github, release_id, os.path.join(DIST_DIR, MKSNAPSHOT_NAME)) if PLATFORM == 'win32': # Upload node headers. execute([ sys.executable, os.path.join(SOURCE_ROOT, 'script', 'upload-node-headers.py'), '-v', ATOM_SHELL_VERSION ])
def main(): if len(sys.argv) != 2 or sys.argv[1] == '-h': print 'Usage: bump-version.py [<version> | major | minor | patch]' return 1 option = sys.argv[1] increments = ['major', 'minor', 'patch', 'build'] if option in increments: version = get_electron_version() versions = parse_version(version.split('-')[0]) versions = increase_version(versions, increments.index(option)) else: versions = parse_version(option) version = '.'.join(versions[:3]) with scoped_cwd(SOURCE_ROOT): update_package_json(version) tag_version(version)
def main(): args = parse_args() if not dist_newer_than_head(): create_dist = os.path.join(SOURCE_ROOT, 'script', 'create-dist.py') execute([sys.executable, create_dist]) build_version = get_atom_shell_build_version() if not ATOM_SHELL_VERSION.startswith(build_version): error = 'Tag name ({0}) should match build version ({1})\n'.format( ATOM_SHELL_VERSION, build_version) sys.stderr.write(error) sys.stderr.flush() return 1 github = GitHub(auth_token()) release_id = create_or_get_release_draft(github, args.version) if args.publish_release: # Upload the SHASUMS.txt. execute([sys.executable, os.path.join(SOURCE_ROOT, 'script', 'upload-checksums.py'), '-v', ATOM_SHELL_VERSION]) # Upload the index.json. execute([sys.executable, os.path.join(SOURCE_ROOT, 'script', 'upload-index-json.py')]) # Press the publish button. publish_release(github, release_id) # Do not upload other files when passed "-p". return # Upload atom-shell with GitHub Releases API. 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 chromedriver and mksnapshot for minor version update. if parse_version(args.version)[2] == '0': upload_atom_shell(github, release_id, os.path.join(DIST_DIR, CHROMEDRIVER_NAME)) upload_atom_shell(github, release_id, os.path.join(DIST_DIR, MKSNAPSHOT_NAME)) if PLATFORM == 'win32': # Upload PDBs to Windows symbol server. execute([sys.executable, os.path.join(SOURCE_ROOT, 'script', 'upload-windows-pdb.py')]) # Upload node headers. execute([sys.executable, os.path.join(SOURCE_ROOT, 'script', 'upload-node-headers.py'), '-v', ATOM_SHELL_VERSION])
def main(): if len(sys.argv) != 2 or sys.argv[1] == "-h": print "Usage: bump-version.py [<version> | major | minor | patch]" return 1 option = sys.argv[1] increments = ["major", "minor", "patch", "build"] if option in increments: version = get_atom_shell_version() versions = parse_version(version.split("-")[0]) versions = increase_version(versions, increments.index(option)) else: versions = parse_version(option) version = ".".join(versions[:3]) with scoped_cwd(SOURCE_ROOT): update_atom_gyp(version) update_win_rc(version, versions) update_version_h(versions) update_info_plist(version) tag_version(version)
def main(): if len(sys.argv) != 2 or sys.argv[1] == '-h': print 'Usage: bump-version.py [<version> | major | minor | patch]' return 1 option = sys.argv[1] increments = ['major', 'minor', 'patch', 'build'] if option in increments: version = get_atom_shell_version() versions = parse_version(version.split('-')[0]) versions = increase_version(versions, increments.index(option)) else: versions = parse_version(option) version = '.'.join(versions[:3]) with scoped_cwd(SOURCE_ROOT): update_atom_gyp(version) update_win_rc(version, versions) update_version_h(versions) update_info_plist(version) tag_version(version)
def main(): args = parse_args() if not dist_newer_than_head(): create_dist = os.path.join(SOURCE_ROOT, 'script', 'create-dist.py') execute([sys.executable, create_dist]) build_version = get_atom_shell_build_version() if not ATOM_SHELL_VERSION.startswith(build_version): error = 'Tag name ({0}) should match build version ({1})\n'.format( ATOM_SHELL_VERSION, build_version) sys.stderr.write(error) sys.stderr.flush() return 1 # Upload atom-shell with GitHub Releases API. github = GitHub(auth_token()) release_id = create_or_get_release_draft(github, args.version) 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 chromedriver for minor version update. if parse_version(args.version)[2] == '0': upload_atom_shell(github, release_id, os.path.join(DIST_DIR, CHROMEDRIVER_NAME)) if args.publish_release: # Upload node's headers to S3. bucket, access_key, secret_key = s3_config() upload_node(bucket, access_key, secret_key, ATOM_SHELL_VERSION) # Upload the SHASUMS.txt. execute([ sys.executable, os.path.join(SOURCE_ROOT, 'script', 'upload-checksums.py'), '-v', ATOM_SHELL_VERSION ]) # Upload PDBs to Windows symbol server. if TARGET_PLATFORM == 'win32': execute([ sys.executable, os.path.join(SOURCE_ROOT, 'script', 'upload-windows-pdb.py') ]) # Press the publish button. publish_release(github, release_id)
def main(): args = parse_args() if not dist_newer_than_head(): create_dist = os.path.join(SOURCE_ROOT, "script", "create-dist.py") execute([sys.executable, create_dist]) build_version = get_atom_shell_build_version() if not ATOM_SHELL_VERSION.startswith(build_version): error = "Tag name ({0}) should match build version ({1})\n".format(ATOM_SHELL_VERSION, build_version) sys.stderr.write(error) sys.stderr.flush() return 1 github = GitHub(auth_token()) release_id = create_or_get_release_draft(github, args.version) if args.publish_release: # Upload the SHASUMS.txt. execute([sys.executable, os.path.join(SOURCE_ROOT, "script", "upload-checksums.py"), "-v", ATOM_SHELL_VERSION]) # Upload the index.json. execute([sys.executable, os.path.join(SOURCE_ROOT, "script", "upload-index-json.py")]) # Press the publish button. publish_release(github, release_id) # Do not upload other files when passed "-p". return # Upload atom-shell with GitHub Releases API. 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 chromedriver and mksnapshot for minor version update. if get_target_arch() != "arm" and parse_version(args.version)[2] == "0": chromedriver = "chromedriver-{0}-{1}-{2}.zip".format(get_chromedriver_version(), PLATFORM, get_target_arch()) upload_atom_shell(github, release_id, os.path.join(DIST_DIR, chromedriver)) upload_atom_shell(github, release_id, os.path.join(DIST_DIR, MKSNAPSHOT_NAME)) if PLATFORM == "win32": # Upload node headers. execute( [sys.executable, os.path.join(SOURCE_ROOT, "script", "upload-node-headers.py"), "-v", ATOM_SHELL_VERSION] )
def main(): args = parse_args() if not dist_newer_than_head(): create_dist = os.path.join(SOURCE_ROOT, 'script', 'create-dist.py') execute([sys.executable, create_dist]) build_version = get_atom_shell_build_version() if not ATOM_SHELL_VERSION.startswith(build_version): error = 'Tag name ({0}) should match build version ({1})\n'.format( ATOM_SHELL_VERSION, build_version) sys.stderr.write(error) sys.stderr.flush() return 1 # Upload atom-shell with GitHub Releases API. github = GitHub(auth_token()) release_id = create_or_get_release_draft(github, args.version) 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 chromedriver for minor version update. if parse_version(args.version)[2] == '0': upload_atom_shell(github, release_id, os.path.join(DIST_DIR, CHROMEDRIVER_NAME)) if args.publish_release: # Upload node's headers to S3. bucket, access_key, secret_key = s3_config() upload_node(bucket, access_key, secret_key, ATOM_SHELL_VERSION) # Upload the SHASUMS.txt. execute([sys.executable, os.path.join(SOURCE_ROOT, 'script', 'upload-checksums.py'), '-v', ATOM_SHELL_VERSION]) # Upload PDBs to Windows symbol server. if TARGET_PLATFORM == 'win32': execute([sys.executable, os.path.join(SOURCE_ROOT, 'script', 'upload-windows-pdb.py')]) # Press the publish button. publish_release(github, release_id)
def create_framework_version_h(): template_file = os.path.join(SOURCE_ROOT, 'script', 'meson_version_h.in') target_file = os.path.join(SOURCE_ROOT, 'src', 'api', 'version.h') vers = parse_version(MESON_VERSION.strip()) with open(template_file, 'r') as f: template = f.read() content = template.replace('{PLACEHOLDER_VERSION_MAJOR}', vers[0]) content = content.replace('{PLACEHOLDER_VERSION_MINOR}', vers[1]) content = content.replace('{PLACEHOLDER_VERSION_REVISION}', vers[2]) should_write = True if os.path.isfile(target_file): with open(target_file, 'r') as f: should_write = f.read() != content if should_write: with open(target_file, 'w') as f: f.write(content)
def main(): args = parse_args() if not args.publish_release: build_version = get_brave_version() if not get_brave_version().startswith(build_version): error = 'Tag name ({0}) should match build version ({1})\n'.format( get_brave_version(), build_version) sys.stderr.write(error) sys.stderr.flush() return 1 github = GitHub(auth_token()) releases = github.repos(BRAVE_REPO).releases.get() tag_exists = False for release in releases: if not release['draft'] and release['tag_name'] == args.version: tag_exists = True break release = create_or_get_release_draft(github, releases, args.version, tag_exists) if args.publish_release: # Create and upload the Brave SHASUMS*.txt release_brave_checksums(github, release) # Press the publish button. # publish_release(github, release['id']) # Do not upload other files when passed "-p". return # Upload Brave with GitHub Releases API. upload_brave(github, release, os.path.join(dist_dir(), DIST_NAME)) upload_brave(github, release, os.path.join(dist_dir(), SYMBOLS_NAME)) # if PLATFORM == 'darwin': # upload_brave(github, release, os.path.join(dist_dir(), DSYM_NAME)) # elif PLATFORM == 'win32': # upload_brave(github, release, os.path.join(dist_dir(), PDB_NAME)) # Upload chromedriver and mksnapshot. chromedriver = get_zip_name('chromedriver', get_chromedriver_version()) upload_brave(github, release, os.path.join(dist_dir(), chromedriver)) if PLATFORM == 'darwin': upload_brave(github, release, os.path.join(output_dir(), 'Brave.dmg')) elif PLATFORM == 'win32': if get_target_arch() == 'x64': upload_brave(github, release, os.path.join(output_dir(), 'brave_installer.exe'), 'brave_installer-x64.exe') else: upload_brave(github, release, os.path.join(output_dir(), 'brave_installer.exe'), 'brave_installer-ia32.exe') # TODO: Enable after linux packaging lands #else: #if get_target_arch() == 'x64': #upload_brave(github, release, os.path.join(output_dir(), 'brave-x86_64.rpm')) #upload_brave(github, release, os.path.join(output_dir(), 'brave-amd64.deb')) #else: #upload_brave(github, release, os.path.join(output_dir(), 'brave-i386.rpm')) #upload_brave(github, release, os.path.join(output_dir(), 'brave-i386.deb')) # mksnapshot = get_zip_name('mksnapshot', get_brave_version()) # upload_brave(github, release, os.path.join(dist_dir(), mksnapshot)) # if PLATFORM == 'win32' and not tag_exists: # # Upload PDBs to Windows symbol server. # run_python_script('upload-windows-pdb.py') versions = parse_version(args.version) version = '.'.join(versions[:3])
def main(): args = parse_args() print('[INFO] Running upload...') # Repo is defined in lib/helpers.py for now repo = GitHub(get_env_var('GITHUB_TOKEN')).repos(BRAVE_REPO) tag = get_brave_version() release = get_draft(repo, tag) if not release: print( "[INFO] No existing release found, creating new release for this upload" ) release = create_release_draft(repo, tag) print('[INFO] Uploading release {}'.format(release['tag_name'])) # Upload Brave with GitHub Releases API. upload_brave(repo, release, os.path.join(dist_dir(), DIST_NAME), force=args.force) upload_brave(repo, release, os.path.join(dist_dir(), SYMBOLS_NAME), force=args.force) # if PLATFORM == 'darwin': # upload_brave(repo, release, os.path.join(dist_dir(), DSYM_NAME)) # elif PLATFORM == 'win32': # upload_brave(repo, release, os.path.join(dist_dir(), PDB_NAME)) # Upload chromedriver and mksnapshot. chromedriver = get_zip_name('chromedriver', get_chromedriver_version()) upload_brave(repo, release, os.path.join(dist_dir(), chromedriver), force=args.force) pkgs = yield_brave_packages(output_dir(), release_channel(), get_raw_version()) if PLATFORM == 'darwin': for pkg in pkgs: upload_brave(repo, release, os.path.join(output_dir(), pkg), force=args.force) elif PLATFORM == 'win32': if get_target_arch() == 'x64': upload_brave(repo, release, os.path.join(output_dir(), 'brave_installer.exe'), 'brave_installer-x64.exe', force=args.force) else: upload_brave(repo, release, os.path.join(output_dir(), 'brave_installer.exe'), 'brave_installer-ia32.exe', force=args.force) else: if get_target_arch() == 'x64': for pkg in pkgs: upload_brave(repo, release, os.path.join(output_dir(), pkg), force=args.force) else: upload_brave(repo, release, os.path.join(output_dir(), 'brave-i386.rpm'), force=args.force) upload_brave(repo, release, os.path.join(output_dir(), 'brave-i386.deb'), force=args.force) # mksnapshot = get_zip_name('mksnapshot', get_brave_version()) # upload_brave(repo, release, os.path.join(dist_dir(), mksnapshot)) # if PLATFORM == 'win32' and not tag_exists: # # Upload PDBs to Windows symbol server. # run_python_script('upload-windows-pdb.py') versions = parse_version(args.version) version = '.'.join(versions[:3]) print('[INFO] Finished upload')
def main(): parser = argparse.ArgumentParser( description='Bump version numbers. Must specify at least one of the three' +' options:\n' +' --bump=patch to increment patch version, or\n' +' --stable to promote current beta to stable, or\n' +' --version={version} to set version number directly\n' +'Note that you can use both --bump and --stable ' +'simultaneously.', formatter_class=argparse.RawTextHelpFormatter ) parser.add_argument( '--version', default=None, dest='new_version', help='new version number' ) parser.add_argument( '--bump', action='store', default=None, dest='bump', help='increment [stable | beta | nightly]' ) parser.add_argument( '--dry-run', action='store_true', default= False, dest='dry_run', help='just to check that version number is correct' ) args = parser.parse_args() curr_version = get_electron_version() if args.bump not in ['stable', 'beta', 'nightly']: raise Exception('bump must be set to either stable, beta or nightly') if is_nightly(curr_version): if args.bump == 'nightly': version = get_next_nightly(curr_version) elif args.bump == 'beta': version = get_next_beta(curr_version) elif args.bump == 'stable': version = get_next_stable_from_pre(curr_version) else: not_reached() elif is_beta(curr_version): if args.bump == 'nightly': version = get_next_nightly(curr_version) elif args.bump == 'beta': version = get_next_beta(curr_version) elif args.bump == 'stable': version = get_next_stable_from_pre(curr_version) else: not_reached() elif is_stable(curr_version): if args.bump == 'nightly': version = get_next_nightly(curr_version) elif args.bump == 'beta': raise Exception("You can\'t bump to a beta from stable") elif args.bump == 'stable': version = get_next_stable_from_stable(curr_version) else: not_reached() else: raise Exception("Invalid current version: " + curr_version) if args.new_version == None and args.bump == None and args.stable == False: parser.print_help() return 1 versions = clean_parse_version(version) suffix = '' if '-' in version: suffix = '-' + version.split('-')[1] versions[3] = parse_version(version)[3] version = version.split('-')[0] if args.dry_run: print 'new version number would be: {0}\n'.format(version + suffix) return 0 with scoped_cwd(SOURCE_ROOT): update_electron_gyp(version, suffix) update_win_rc(version, versions) update_version_h(versions, suffix) update_info_plist(version) update_package_json(version, suffix) tag_version(version, suffix) print 'Bumped to version: {0}'.format(version + suffix)
def main(): args = parse_args() if not args.publish_release: build_version = get_electron_build_version() if not get_electron_version().startswith(build_version): error = 'Tag name ({0}) should match build version ({1})\n'.format( get_electron_version(), build_version) sys.stderr.write(error) sys.stderr.flush() return 1 github = GitHub(auth_token()) releases = github.repos(ELECTRON_REPO).releases.get() tag_exists = False for release in releases: if not release['draft'] and release['tag_name'] == args.version: tag_exists = True break release = create_or_get_release_draft(github, releases, args.version, tag_exists) if args.publish_release: # Upload the Node SHASUMS*.txt. run_python_script('upload-node-checksums.py', '-v', get_electron_version(), '--dist-url', args.dist_url) # Upload the index.json. # run_python_script('upload-index-json.py') # Create and upload the Electron SHASUMS*.txt release_electron_checksums(github, release) # Press the publish button. # publish_release(github, release['id']) # Do not upload other files when passed "-p". return # Upload Electron with GitHub Releases API. upload_electron(github, release, os.path.join(dist_dir(), DIST_NAME)) upload_electron(github, release, os.path.join(dist_dir(), SYMBOLS_NAME)) # if PLATFORM == 'darwin': # upload_electron(github, release, os.path.join(dist_dir(), DSYM_NAME)) # elif PLATFORM == 'win32': # upload_electron(github, release, os.path.join(dist_dir(), PDB_NAME)) # Upload chromedriver and mksnapshot. chromedriver = get_zip_name('chromedriver', get_chromedriver_version()) upload_electron(github, release, os.path.join(dist_dir(), chromedriver)) # mksnapshot = get_zip_name('mksnapshot', get_electron_version()) # upload_electron(github, release, os.path.join(dist_dir(), mksnapshot)) # if PLATFORM == 'win32' and not tag_exists: # # Upload PDBs to Windows symbol server. # run_python_script('upload-windows-pdb.py') # Upload node headers. versions = parse_version(args.version) version = '.'.join(versions[:3]) run_python_script('upload-node-headers.py', '-v', 'v' + version)
def main(): args = parse_args() if not args.publish_release: if not dist_newer_than_head(): run_python_script('create-dist.py') build_version = get_electron_build_version() if not ELECTRON_VERSION.startswith(build_version): error = 'Tag name ({0}) should match build version ({1})\n'.format( ELECTRON_VERSION, build_version) sys.stderr.write(error) sys.stderr.flush() return 1 github = GitHub(auth_token()) releases = github.repos(ELECTRON_REPO).releases.get() tag_exists = False for release in releases: if not release['draft'] and release['tag_name'] == args.version: tag_exists = True break release = create_or_get_release_draft(github, releases, args.version, tag_exists) if args.publish_release: # Upload the Node SHASUMS*.txt. run_python_script('upload-node-checksums.py', '-v', ELECTRON_VERSION) # Upload the index.json. run_python_script('upload-index-json.py') # Create and upload the Electron SHASUMS*.txt release_electron_checksums(github, release) # Press the publish button. publish_release(github, release['id']) # Do not upload other files when passed "-p". return # Upload Electron with GitHub Releases API. upload_electron(github, release, os.path.join(DIST_DIR, DIST_NAME)) upload_electron(github, release, os.path.join(DIST_DIR, SYMBOLS_NAME)) if PLATFORM == 'darwin': upload_electron(github, release, os.path.join(DIST_DIR, 'electron-api.json')) upload_electron(github, release, os.path.join(DIST_DIR, 'electron.d.ts')) upload_electron(github, release, os.path.join(DIST_DIR, DSYM_NAME)) elif PLATFORM == 'win32': upload_electron(github, release, os.path.join(DIST_DIR, PDB_NAME)) # Upload free version of ffmpeg. ffmpeg = get_zip_name('ffmpeg', ELECTRON_VERSION) upload_electron(github, release, os.path.join(DIST_DIR, ffmpeg)) # Upload chromedriver and mksnapshot for minor version update. if parse_version(args.version)[2] == '0': chromedriver = get_zip_name('chromedriver', ELECTRON_VERSION) upload_electron(github, release, os.path.join(DIST_DIR, chromedriver)) mksnapshot = get_zip_name('mksnapshot', ELECTRON_VERSION) upload_electron(github, release, os.path.join(DIST_DIR, mksnapshot)) if PLATFORM == 'win32' and not tag_exists: # Upload PDBs to Windows symbol server. run_python_script('upload-windows-pdb.py') # Upload node headers. run_python_script('upload-node-headers.py', '-v', args.version)
def main(): parser = argparse.ArgumentParser( description='Bump version numbers. Must specify at least one of the three' +' options:\n' +' --bump=patch to increment patch version, or\n' +' --stable to promote current beta to stable, or\n' +' --version={version} to set version number directly\n' +'Note that you can use both --bump and --stable ' +'simultaneously.', formatter_class=argparse.RawTextHelpFormatter ) parser.add_argument( '--version', default=None, dest='new_version', help='new version number' ) parser.add_argument( '--bump', action='store', default=None, dest='bump', help='increment [major | minor | patch | beta]' ) parser.add_argument( '--stable', action='store_true', default= False, dest='stable', help='promote to stable (i.e. remove `-beta.x` suffix)' ) parser.add_argument( '--dry-run', action='store_true', default= False, dest='dry_run', help='just to check that version number is correct' ) args = parser.parse_args() if args.new_version == None and args.bump == None and args.stable == False: parser.print_help() return 1 increments = ['major', 'minor', 'patch', 'beta'] curr_version = get_electron_version() versions = parse_version(re.sub('-beta', '', curr_version)) if args.bump in increments: versions = increase_version(versions, increments.index(args.bump)) if versions[3] == '0': # beta starts at 1 versions = increase_version(versions, increments.index('beta')) if args.stable == True: versions[3] = '0' if args.new_version != None: versions = parse_version(re.sub('-beta', '', args.new_version)) version = '.'.join(versions[:3]) suffix = '' if versions[3] == '0' else '-beta.' + versions[3] if args.dry_run: print 'new version number would be: {0}\n'.format(version + suffix) return 0 with scoped_cwd(SOURCE_ROOT): update_electron_gyp(version, suffix) update_win_rc(version, versions) update_version_h(versions) update_info_plist(version) update_package_json(version, suffix) tag_version(version, suffix)
def main(): args = parse_args() if not dist_newer_than_head(): run_python_script('create-dist.py') build_version = get_electron_build_version() if not ELECTRON_VERSION.startswith(build_version): error = 'Tag name ({0}) should match build version ({1})\n'.format( ELECTRON_VERSION, build_version) sys.stderr.write(error) sys.stderr.flush() return 1 github = GitHub(auth_token()) releases = github.repos(ELECTRON_REPO).releases.get() tag_exists = False for r in releases: if not r['draft'] and r['tag_name'] == args.version: release = r tag_exists = True break if not args.upload_to_s3: assert tag_exists == args.overwrite, \ 'You have to pass --overwrite to overwrite a published release' if not args.overwrite: release = create_or_get_release_draft(github, releases, args.version, tag_exists) # Upload Electron with GitHub Releases API. upload_electron(github, release, os.path.join(DIST_DIR, DIST_NAME), args.upload_to_s3) if get_target_arch() != 'mips64el': upload_electron(github, release, os.path.join(DIST_DIR, SYMBOLS_NAME), args.upload_to_s3) if PLATFORM == 'darwin': upload_electron(github, release, os.path.join(DIST_DIR, 'electron-api.json'), args.upload_to_s3) upload_electron(github, release, os.path.join(DIST_DIR, 'electron.d.ts'), args.upload_to_s3) upload_electron(github, release, os.path.join(DIST_DIR, DSYM_NAME), args.upload_to_s3) elif PLATFORM == 'win32': upload_electron(github, release, os.path.join(DIST_DIR, PDB_NAME), args.upload_to_s3) # Upload free version of ffmpeg. ffmpeg = get_zip_name('ffmpeg', ELECTRON_VERSION) upload_electron(github, release, os.path.join(DIST_DIR, ffmpeg), args.upload_to_s3) # Upload chromedriver and mksnapshot for minor version update. if parse_version(args.version)[2] == '0': chromedriver = get_zip_name('chromedriver', ELECTRON_VERSION) upload_electron(github, release, os.path.join(DIST_DIR, chromedriver), args.upload_to_s3) mksnapshot = get_zip_name('mksnapshot', ELECTRON_VERSION) upload_electron(github, release, os.path.join(DIST_DIR, mksnapshot), args.upload_to_s3) if PLATFORM == 'win32' and not tag_exists and not args.upload_to_s3: # Upload PDBs to Windows symbol server. run_python_script('upload-windows-pdb.py') # Upload node headers. run_python_script('create-node-headers.py', '-v', args.version) run_python_script('upload-node-headers.py', '-v', args.version)
def main(): args = parse_args() if not args.publish_release: if not dist_newer_than_head(): create_dist = os.path.join(SOURCE_ROOT, 'script', 'create-dist.py') execute([sys.executable, create_dist]) build_version = get_atom_shell_build_version() if not ATOM_SHELL_VERSION.startswith(build_version): error = 'Tag name ({0}) should match build version ({1})\n'.format( ATOM_SHELL_VERSION, build_version) sys.stderr.write(error) sys.stderr.flush() return 1 github = GitHub(auth_token()) releases = github.repos(ATOM_SHELL_REPO).releases.get() tag_exists = False for release in releases: if not release['draft'] and release['tag_name'] == args.version: tag_exists = True break release = create_or_get_release_draft(github, releases, args.version, tag_exists) if args.publish_release: # Upload the SHASUMS.txt. execute([ sys.executable, os.path.join(SOURCE_ROOT, 'script', 'upload-checksums.py'), '-v', ATOM_SHELL_VERSION ]) # Upload the index.json. execute([ sys.executable, os.path.join(SOURCE_ROOT, 'script', 'upload-index-json.py') ]) # Press the publish button. publish_release(github, release['id']) # Do not upload other files when passed "-p". return # Upload atom-shell with GitHub Releases API. upload_atom_shell(github, release, os.path.join(DIST_DIR, DIST_NAME)) upload_atom_shell(github, release, os.path.join(DIST_DIR, SYMBOLS_NAME)) # Upload chromedriver and mksnapshot for minor version update. if parse_version(args.version)[2] == '0': chromedriver = 'chromedriver-{0}-{1}-{2}.zip'.format( get_chromedriver_version(), get_platform_key(), get_target_arch()) upload_atom_shell(github, release, os.path.join(DIST_DIR, chromedriver)) upload_atom_shell(github, release, os.path.join(DIST_DIR, MKSNAPSHOT_NAME)) if PLATFORM == 'win32' and not tag_exists: # Upload node headers. execute([ sys.executable, os.path.join(SOURCE_ROOT, 'script', 'upload-node-headers.py'), '-v', args.version ])
def main(): parser = argparse.ArgumentParser( description='Bump version numbers. Must specify at least one of the three' +' options:\n' +' --bump=patch to increment patch version, or\n' +' --stable to promote current beta to stable, or\n' +' --version={version} to set version number directly\n' +'Note that you can use both --bump and --stable ' +'simultaneously.', formatter_class=argparse.RawTextHelpFormatter ) parser.add_argument( '--version', default=None, dest='new_version', help='new version number' ) parser.add_argument( '--bump', action='store', default=None, dest='bump', help='increment [stable | beta | nightly]' ) parser.add_argument( '--dry-run', action='store_true', default= False, dest='dry_run', help='just to check that version number is correct' ) args = parser.parse_args() curr_version = get_electron_version() if args.bump not in ['stable', 'beta', 'nightly']: raise Exception('bump must be set to either stable, beta or nightly') if is_nightly(curr_version): if args.bump == 'nightly': version = get_next_nightly(curr_version) elif args.bump == 'beta': version = get_next_beta(curr_version) elif args.bump == 'stable': version = get_next_stable_from_pre(curr_version) else: not_reached() elif is_beta(curr_version): if args.bump == 'nightly': version = get_next_nightly(curr_version) elif args.bump == 'beta': version = get_next_beta(curr_version) elif args.bump == 'stable': version = get_next_stable_from_pre(curr_version) else: not_reached() elif is_stable(curr_version): if args.bump == 'nightly': version = get_next_nightly(curr_version) elif args.bump == 'beta': raise Exception("You can\'t bump to a beta from stable") elif args.bump == 'stable': version = get_next_stable_from_stable(curr_version) else: not_reached() else: raise Exception("Invalid current version: " + curr_version) if args.new_version is None and args.bump is None and not args.stable: parser.print_help() return 1 versions = clean_parse_version(version) suffix = '' if '-' in version: suffix = '-' + version.split('-')[1] versions[3] = parse_version(version)[3] version = version.split('-')[0] if args.dry_run: print 'new version number would be: {0}\n'.format(version + suffix) return 0 with scoped_cwd(SOURCE_ROOT): update_version(version, suffix) update_win_rc(version, versions, args.bump == "nightly") update_version_h(versions, suffix) update_info_plist(version) update_package_json(version, suffix) tag_version(version, suffix) print 'Bumped to version: {0}'.format(version + suffix)
def main(): args = parse_args() if not args.publish_release: if not dist_newer_than_head(): run_python_script('create-dist.py') build_version = get_electron_build_version() if not ELECTRON_VERSION.startswith(build_version): error = 'Tag name ({0}) should match build version ({1})\n'.format( ELECTRON_VERSION, build_version) sys.stderr.write(error) sys.stderr.flush() return 1 github = GitHub(auth_token()) releases = github.repos(ELECTRON_REPO).releases.get() tag_exists = False for release in releases: if not release['draft'] and release['tag_name'] == args.version: tag_exists = True break release = create_or_get_release_draft(github, releases, args.version, tag_exists) if args.publish_release: # Upload the Node SHASUMS*.txt. run_python_script('upload-node-checksums.py', '-v', ELECTRON_VERSION) # Upload the index.json. run_python_script('upload-index-json.py') # Create and upload the Electron SHASUMS*.txt release_electron_checksums(github, release) # Press the publish button. publish_release(github, release['id']) # Do not upload other files when passed "-p". return # Upload Electron with GitHub Releases API. upload_electron(github, release, os.path.join(DIST_DIR, DIST_NAME)) upload_electron(github, release, os.path.join(DIST_DIR, SYMBOLS_NAME)) if PLATFORM == 'darwin': upload_electron(github, release, os.path.join(DIST_DIR, 'electron-api.json')) upload_electron(github, release, os.path.join(DIST_DIR, 'electron.d.ts')) upload_electron(github, release, os.path.join(DIST_DIR, DSYM_NAME)) elif PLATFORM == 'win32': upload_electron(github, release, os.path.join(DIST_DIR, PDB_NAME)) # Upload free version of ffmpeg. ffmpeg = get_zip_name('ffmpeg', ELECTRON_VERSION) upload_electron(github, release, os.path.join(DIST_DIR, ffmpeg)) # Upload chromedriver and mksnapshot for minor version update. if parse_version(args.version)[2] == '0': chromedriver = get_zip_name('chromedriver', ELECTRON_VERSION) upload_electron(github, release, os.path.join(DIST_DIR, chromedriver)) mksnapshot = get_zip_name('mksnapshot', ELECTRON_VERSION) upload_electron(github, release, os.path.join(DIST_DIR, mksnapshot)) if PLATFORM == 'win32' and not tag_exists: # Upload PDBs to Windows symbol server. run_python_script('upload-windows-pdb.py') # Upload node headers. run_python_script('create-node-headers.py', '-v', args.version) run_python_script('upload-node-headers.py', '-v', args.version)
def main(): parser = argparse.ArgumentParser( description= 'Bump version numbers. Must specify at least one of the three' + ' options:\n' + ' --bump=patch to increment patch version, or\n' + ' --stable to promote current beta to stable, or\n' + ' --version={version} to set version number directly\n' + 'Note that you can use both --bump and --stable ' + 'simultaneously.', formatter_class=argparse.RawTextHelpFormatter) parser.add_argument('--version', default=None, dest='new_version', help='new version number') parser.add_argument('--bump', action='store', default=None, dest='bump', help='increment [major | minor | patch | beta]') parser.add_argument( '--stable', action='store_true', default=False, dest='stable', help='promote to stable (i.e. remove `-beta.x` suffix)') parser.add_argument('--dry-run', action='store_true', default=False, dest='dry_run', help='just to check that version number is correct') args = parser.parse_args() if args.new_version == None and args.bump == None and args.stable == False: parser.print_help() return 1 increments = ['major', 'minor', 'patch', 'beta'] curr_version = get_electron_version() versions = parse_version(re.sub('-beta', '', curr_version)) if args.bump in increments: versions = increase_version(versions, increments.index(args.bump)) if versions[3] == '0': # beta starts at 1 versions = increase_version(versions, increments.index('beta')) if args.stable == True: versions[3] = '0' if args.new_version != None: clean_version = re.sub('-beta', '', args.new_version) clean_version = re.sub('-nightly', '', clean_version) versions = parse_version(clean_version) version = '.'.join(versions[:3]) suffix = '' if args.new_version != None and '-nightly' in args.new_version: suffix = '-nightly.' + versions[3] elif versions[3] != '0': suffix = '-beta.' + versions[3] if args.dry_run: print 'new version number would be: {0}\n'.format(version + suffix) return 0 with scoped_cwd(SOURCE_ROOT): update_electron_gyp(version, suffix) update_win_rc(version, versions) update_version_h(versions, suffix) update_info_plist(version) update_package_json(version, suffix) tag_version(version, suffix) print 'Bumped to version: {0}'.format(version + suffix)