Exemplo n.º 1
0
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))
    if args.publish_release:
        publish_release(github, release_id)

    # Upload node's headers to S3.
    bucket, access_key, secret_key = s3_config()
    upload_node(bucket, access_key, secret_key, NODE_VERSION)
Exemplo n.º 2
0
def upload_node(bucket, access_key, secret_key, version):
  with scoped_cwd(DIST_DIR):
    s3put(bucket, access_key, secret_key, DIST_DIR,
          'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz'))

  if TARGET_PLATFORM == 'win32':
    # Copy atom.lib to node.lib
    node_lib = os.path.join(OUT_DIR, 'node.lib')
    atom_lib = os.path.join(OUT_DIR, 'node.dll.lib')
    shutil.copy2(atom_lib, node_lib)

    # Upload the 32bit node.lib.
    s3put(bucket, access_key, secret_key, OUT_DIR,
          'atom-shell/dist/{0}'.format(version), [node_lib])

    # Upload the fake 64bit node.lib.
    touch_x64_node_lib()
    node_lib = os.path.join(OUT_DIR, 'x64', 'node.lib')
    s3put(bucket, access_key, secret_key, OUT_DIR,
          'atom-shell/dist/{0}'.format(version), [node_lib])

    # Upload the index.json
    with scoped_cwd(SOURCE_ROOT):
      atom_shell = os.path.join(OUT_DIR, 'atom.exe')
      index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json'))
      execute([atom_shell,
               os.path.join('script', 'dump-version-info.js'),
               index_json])
      s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist',
            [index_json])
Exemplo n.º 3
0
def upload_node(bucket, access_key, secret_key, version):
  with scoped_cwd(DIST_DIR):
    s3put(bucket, access_key, secret_key, DIST_DIR,
          'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz'))

  if TARGET_PLATFORM == 'win32':
    # Generate the node.lib.
    build = os.path.join(SOURCE_ROOT, 'script', 'build.py')
    execute([sys.executable, build, '-c', 'Release', '-t', 'generate_node_lib'])

    # Upload the 32bit node.lib.
    node_lib = os.path.join(OUT_DIR, 'node.lib')
    s3put(bucket, access_key, secret_key, OUT_DIR,
          'atom-shell/dist/{0}'.format(version), [node_lib])

    # Upload the fake 64bit node.lib.
    touch_x64_node_lib()
    node_lib = os.path.join(OUT_DIR, 'x64', 'node.lib')
    s3put(bucket, access_key, secret_key, OUT_DIR,
          'atom-shell/dist/{0}'.format(version), [node_lib])

    # Upload the index.json
    with scoped_cwd(SOURCE_ROOT):
      atom_shell = os.path.join(OUT_DIR, 'atom.exe')
      index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json'))
      execute([atom_shell,
               os.path.join('script', 'dump-version-info.js'),
               index_json])
      s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist',
            [index_json])
Exemplo n.º 4
0
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_atom_shell(github, release_id,
                    os.path.join(DIST_DIR, CHROMEDRIVER_NAME))

  # Upload node's headers to S3.
  bucket, access_key, secret_key = s3_config()
  upload_node(bucket, access_key, secret_key, ATOM_SHELL_VERSION)

  if args.publish_release:
    # Press the publish button.
    publish_release(github, release_id)

    # Upload the SHASUMS.txt.
    execute([sys.executable,
             os.path.join(SOURCE_ROOT, 'script', 'upload-checksums.py'),
             '-v', ATOM_SHELL_VERSION])
Exemplo n.º 5
0
def copy_chromedriver():
  build = os.path.join(SOURCE_ROOT, 'script', 'build.py')
  execute([sys.executable, build, '-c', 'Release', '-t', 'copy_chromedriver'])
  binary = 'chromedriver'
  if TARGET_PLATFORM == 'win32':
    binary += '.exe'
  shutil.copy2(os.path.join(OUT_DIR, binary), DIST_DIR)
Exemplo n.º 6
0
def main(destination):
  rm_rf(destination)
  (project_name, product_name) = get_names_from_gyp()

  if PLATFORM in ['darwin', 'linux']:
    generate_breakpad_symbols = os.path.join(SOURCE_ROOT, 'tools', 'posix',
                                             'generate_breakpad_symbols.py')
    if PLATFORM == 'darwin':
      start = os.path.join(OUT_DIR, '{0}.app'.format(product_name), 'Contents',
                           'MacOS', product_name)
    else:
      start = os.path.join(OUT_DIR, project_name)
    args = [
      '--build-dir={0}'.format(OUT_DIR),
      '--binary={0}'.format(start),
      '--symbols-dir={0}'.format(destination),
      '--libchromiumcontent-dir={0}'.format(CHROMIUM_DIR),
      '--clear',
      '--jobs=16',
    ]
  else:
    generate_breakpad_symbols = os.path.join(SOURCE_ROOT, 'tools', 'win',
                                             'generate_breakpad_symbols.py')
    args = [
      '--symbols-dir={0}'.format(destination),
      '--jobs=16',
      os.path.relpath(OUT_DIR),
    ]

  execute([sys.executable, generate_breakpad_symbols] + args)
Exemplo n.º 7
0
def test_version(args, attempt, tag):
    global tag_names

    # get the OS specific installer
    asset = None
    while len(tag_names) > 0 and not asset:
        print('\nattempt ' + str(attempt) + '] getting installer for  "' + tag +
              '" (release id ' + str(releases[tag]['id']) + ')')
        asset = get_release_asset(tag)
        if not asset:
            return False

    if not args.demo_mode:
        download_dir = tempdir('build-bisect_')
        download_path = os.path.join(download_dir, asset['name'])
        print('- downloading to ' + download_path)
        download(tag, asset['browser_download_url'], download_path)

        install_path = install(download_dir, download_path)
        profile_dir = setup_profile_directory(args)

        print('- running binary')
        run_cmd = get_run_cmd(install_path, profile_dir)
        execute(run_cmd)

    first = True
    while True:
        if not first:
            print('please type either `y` for yes or `n` for no!')
        answer = raw_input('Did this version work?: y/n\n')
        first = False
        if answer == 'y' or answer == 'n':
            break

    return answer == 'y'
Exemplo n.º 8
0
def update_atom_modules(dirname):
  with scoped_cwd(dirname):
    apm = os.path.join(SOURCE_ROOT, 'node_modules', '.bin', 'apm')
    if sys.platform in ['win32', 'cygwin']:
      apm = os.path.join(SOURCE_ROOT, 'node_modules', 'atom-package-manager',
                         'bin', 'apm.cmd')
    execute([apm, 'install'])
Exemplo n.º 9
0
def strip_binary(binary_path):
    if get_target_arch() == 'arm':
      strip = 'arm-linux-gnueabihf-strip'
    elif get_target_arch() == 'arm64':
      strip = 'aarch64-linux-gnu-strip'
    else:
      strip = 'strip'
    execute([strip, binary_path])
Exemplo n.º 10
0
def strip_binaries():
  if get_target_arch() == 'arm':
    strip = 'arm-linux-gnueabihf-strip'
  else:
    strip = 'strip'
  for binary in TARGET_BINARIES[PLATFORM]:
    if binary.endswith('.so') or '.' not in binary:
      execute([strip, os.path.join(DIST_DIR, binary)])
Exemplo n.º 11
0
def create_api_json_schema():
  node_bin_dir = os.path.join(SOURCE_ROOT, 'node_modules', '.bin')
  env = os.environ.copy()
  env['PATH'] = os.path.pathsep.join([node_bin_dir, env['PATH']])
  outfile = os.path.relpath(os.path.join(DIST_DIR, 'electron-api.json'))
  execute(['electron-docs-linter', 'docs', '--outfile={0}'.format(outfile),
           '--version={}'.format(ELECTRON_VERSION.replace('v', ''))],
          env=env)
Exemplo n.º 12
0
def create_typescript_definitions():
  node_bin_dir = os.path.join(SOURCE_ROOT, 'node_modules', '.bin')
  env = os.environ.copy()
  env['PATH'] = os.path.pathsep.join([node_bin_dir, env['PATH']])
  infile = os.path.relpath(os.path.join(DIST_DIR, 'electron-api.json'))
  outfile = os.path.relpath(os.path.join(DIST_DIR, 'electron.d.ts'))
  execute(['electron-typescript-definitions', '--in={0}'.format(infile),
           '--out={0}'.format(outfile)], env=env)
Exemplo n.º 13
0
def tag_version(version, suffix):
  execute([
    'git',
    'commit',
    '-a',
    '-m',
    'Bump v{0}'.format(version + suffix),
    '-n'
  ])
Exemplo n.º 14
0
def create_symbols():
    destination = os.path.join(DIST_DIR, "{0}.breakpad.syms".format(PROJECT_NAME))
    dump_symbols = os.path.join(SOURCE_ROOT, "script", "dump-symbols.py")
    execute([sys.executable, dump_symbols, destination])

    if PLATFORM == "darwin":
        dsyms = glob.glob(os.path.join(OUT_DIR, "*.dSYM"))
        for dsym in dsyms:
            shutil.copytree(dsym, os.path.join(DIST_DIR, os.path.basename(dsym)))
Exemplo n.º 15
0
def create_symbols():
  destination = os.path.join(DIST_DIR, '{0}.breakpad.syms'.format(PROJECT_NAME))
  dump_symbols = os.path.join(SOURCE_ROOT, 'script', 'dump-symbols.py')
  execute([sys.executable, dump_symbols, destination])

  if PLATFORM == 'darwin':
    dsyms = glob.glob(os.path.join(OUT_DIR, '*.dSYM'))
    for dsym in dsyms:
      shutil.copytree(dsym, os.path.join(DIST_DIR, os.path.basename(dsym)))
Exemplo n.º 16
0
def strip_binary(binary_path, target_cpu):
  if target_cpu == 'arm':
    strip = 'arm-linux-gnueabihf-strip'
  elif target_cpu == 'arm64':
    strip = 'aarch64-linux-gnu-strip'
  elif target_cpu == 'mips64el':
    strip = 'mips64el-redhat-linux-strip'
  else:
    strip = 'strip'
  execute([strip, binary_path])
Exemplo n.º 17
0
def strip_binary(binary_path):
  if get_target_arch() == 'arm':
    strip = 'arm-linux-gnueabihf-strip'
  elif get_target_arch() == 'arm64':
    strip = 'aarch64-linux-gnu-strip'
  elif get_target_arch() == 'mips64el':
    strip = 'mips64el-redhat-linux-strip'
  else:
    strip = 'strip'
  execute([strip, binary_path], env=build_env())
Exemplo n.º 18
0
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])
Exemplo n.º 19
0
def s3put(bucket, access_key, secret_key, prefix, key_prefix, files):
  args = [
    's3put',
    '--bucket', bucket,
    '--access_key', access_key,
    '--secret_key', secret_key,
    '--prefix', prefix,
    '--key_prefix', key_prefix,
    '--grant', 'public-read'
  ] + files

  execute(args)
Exemplo n.º 20
0
def main():
  os.chdir(SOURCE_ROOT)

  coffeelint = os.path.join(SOURCE_ROOT, 'node_modules', '.bin', 'coffeelint')
  if sys.platform in ['win32', 'cygwin']:
    coffeelint += '.cmd'
  settings = ['--quiet', '-f', os.path.join('script', 'coffeelint.json')]
  files = glob.glob('atom/browser/api/lib/*.coffee') + \
          glob.glob('atom/renderer/api/lib/*.coffee') + \
          glob.glob('atom/common/api/lib/*.coffee') + \
          glob.glob('atom/browser/atom/*.coffee')

  execute([coffeelint] + settings + files)
Exemplo n.º 21
0
def generate_posix_symbols(binary, source_root, build_dir, destination):
  generate_breakpad_symbols = os.path.join(source_root, 'components', 'crash',
                                          'content', 'tools',
                                          'generate_breakpad_symbols.py')
  args = [
    '--build-dir={0}'.format(build_dir),
    '--symbols-dir={0}'.format(destination),
    '--jobs=16',
    '--binary={0}'.format(binary),
  ]
  if is_verbose_mode():
    args += ['--verbose']
  execute([sys.executable, generate_breakpad_symbols] + args)
Exemplo n.º 22
0
def main():
    # Upload the index.json.
    with scoped_cwd(SOURCE_ROOT):
        if sys.platform == "darwin":
            atom_shell = os.path.join(OUT_DIR, "{0}.app".format(PRODUCT_NAME), "Contents", "MacOS", PRODUCT_NAME)
        elif sys.platform == "win32":
            atom_shell = os.path.join(OUT_DIR, "{0}.exe".format(PROJECT_NAME))
        else:
            atom_shell = os.path.join(OUT_DIR, PROJECT_NAME)
        index_json = os.path.relpath(os.path.join(OUT_DIR, "index.json"))
        execute([atom_shell, os.path.join("tools", "dump-version-info.js"), index_json])

        bucket, access_key, secret_key = s3_config()
        s3put(bucket, access_key, secret_key, OUT_DIR, "atom-shell/dist", [index_json])
Exemplo n.º 23
0
def main():
  # Upload the index.json.
  with scoped_cwd(SOURCE_ROOT):
    atom_shell = os.path.join(OUT_DIR, 'atom')
    if PLATFORM == 'win32':
      atom_shell += '.exe'
    index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json'))
    execute([atom_shell,
             os.path.join('tools', 'dump-version-info.js'),
             index_json])

    bucket, access_key, secret_key = s3_config()
    s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist',
          [index_json])
Exemplo n.º 24
0
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])
Exemplo n.º 25
0
def main():
  os.chdir(SOURCE_ROOT)

  eslint = os.path.join(SOURCE_ROOT, 'node_modules', '.bin', 'eslint')
  if sys.platform in ['win32', 'cygwin']:
    eslint += '.cmd'
  settings = ['--quiet', '--config']

  sourceConfig = os.path.join('script', 'eslintrc-base.json')
  sourceFiles = ['atom']
  execute([eslint] + settings + [sourceConfig] + sourceFiles)

  specConfig = os.path.join('script', 'eslintrc-spec.json')
  specFiles = glob.glob('spec/*.js')
  execute([eslint] + settings + [specConfig] + specFiles)
Exemplo n.º 26
0
 def initialize(self, args):
     try:
         self.is_verbose = args.verbose
         self.is_dryrun = args.dry_run
         self.title = args.title
         # validate channel names
         validate_channel(args.uplift_to)
         validate_channel(args.start_from)
         # read github token FIRST from CLI, then from .npmrc
         self.github_token = get_env_var('GITHUB_TOKEN')
         if len(self.github_token) == 0:
             try:
                 result = execute(['npm', 'config', 'get', 'BRAVE_GITHUB_TOKEN']).strip()
                 if result == 'undefined':
                     raise Exception('`BRAVE_GITHUB_TOKEN` value not found!')
                 self.github_token = result
             except Exception as e:
                 print('[ERROR] no valid GitHub token was found either in npmrc or ' +
                       'via environment variables (BRAVE_GITHUB_TOKEN)')
                 return 1
         # if `--owners` is not provided, fall back to user owning token
         self.parsed_owners = parse_user_logins(self.github_token, args.owners, verbose=self.is_verbose)
         if len(self.parsed_owners) == 0:
             self.parsed_owners = [get_authenticated_user_login(self.github_token)]
         self.labels = parse_labels(self.github_token, BRAVE_CORE_REPO, args.labels, verbose=self.is_verbose)
         if self.is_verbose:
             print('[INFO] config: ' + str(vars(self)))
         return 0
     except Exception as e:
         print('[ERROR] error returned from GitHub API while initializing config: ' + str(e))
         return 1
Exemplo n.º 27
0
def create_symbols():
  if get_target_arch() == 'mips64el':
    return

  destination = os.path.join(DIST_DIR, '{0}.breakpad.syms'.format(PROJECT_NAME))
  dump_symbols = os.path.join(SOURCE_ROOT, 'script', 'dump-symbols.py')
  execute([sys.executable, dump_symbols, destination])

  if PLATFORM == 'darwin':
    dsyms = glob.glob(os.path.join(OUT_DIR, '*.dSYM'))
    for dsym in dsyms:
      shutil.copytree(dsym, os.path.join(DIST_DIR, os.path.basename(dsym)))
  elif PLATFORM == 'win32':
    pdbs = glob.glob(os.path.join(OUT_DIR, '*.pdb'))
    for pdb in pdbs:
      shutil.copy2(pdb, DIST_DIR)
Exemplo n.º 28
0
def get_github_token():
    github_token = get_env_var('GITHUB_TOKEN')
    if len(github_token) == 0:
        result = execute(['npm', 'config', 'get', 'BRAVE_GITHUB_TOKEN']).strip()
        if result == 'undefined':
            raise Exception('`BRAVE_GITHUB_TOKEN` value not found!')
        return result
Exemplo n.º 29
0
def main():
  safe_mkdir(DIST_DIR)

  args = parse_args()
  dist_headers_dir = os.path.join(DIST_DIR, 'node-{0}'.format(args.version))

  copy_headers(dist_headers_dir)
  create_header_tarball(dist_headers_dir)

  # Upload node's headers to S3.
  bucket, access_key, secret_key = s3_config()
  upload_node(bucket, access_key, secret_key, args.version)

  # Upload the SHASUMS.txt.
  execute([sys.executable,
           os.path.join(SOURCE_ROOT, 'script', 'upload-checksums.py'),
           '-v', args.version])
Exemplo n.º 30
0
def main():
  # Upload the index.json.
  with scoped_cwd(SOURCE_ROOT):
    if sys.platform == 'darwin':
      atom_shell = os.path.join(OUT_DIR, '{0}.app'.format(PRODUCT_NAME),
                                'Contents', 'MacOS', PRODUCT_NAME)
    elif sys.platform == 'win32':
      atom_shell = os.path.join(OUT_DIR, '{0}.exe'.format(PROJECT_NAME))
    else:
      atom_shell = os.path.join(OUT_DIR, PROJECT_NAME)
    index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json'))
    execute([atom_shell,
             os.path.join('tools', 'dump-version-info.js'),
             index_json])

    bucket, access_key, secret_key = s3_config()
    s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist',
          [index_json])
Exemplo n.º 31
0
def call_cpplint(files):
    cpplint = os.path.join(SOURCE_ROOT, 'vendor', 'depot_tools', 'cpplint.py')
    execute([sys.executable, cpplint] + files)
Exemplo n.º 32
0
def run_symstore(pdb, dest, product):
    execute(['symstore', 'add', '/r', '/f', pdb, '/s', dest, '/t', product])
Exemplo n.º 33
0
def git_push():
    execute(['git', 'push'])
    execute(['git', 'push', '--tags'])
Exemplo n.º 34
0
def run_python_script(script, *args):
    script_path = os.path.join(SOURCE_ROOT, 'script', script)
    return execute([sys.executable, script_path] + list(args))
Exemplo n.º 35
0
def upload_io_to_github(release, filename, filepath):
    print 'Uploading %s to Github' % \
        (filename)
    script_path = os.path.join(SOURCE_ROOT, 'script', 'upload-to-github.js')
    execute(['node', script_path, filepath, filename, str(release['id'])])
Exemplo n.º 36
0
def run_python_upload_script(script, *args):
    script_path = os.path.join(ELECTRON_DIR, 'script', 'release', 'uploaders',
                               script)
    return execute([sys.executable, script_path] + list(args))
Exemplo n.º 37
0
def tag_version(version, suffix):
    execute(
        ['git', 'commit', '-a', '-m', 'Bump v{0}'.format(version + suffix)])
Exemplo n.º 38
0
def get_release(version):
    script_path = os.path.join(SOURCE_ROOT, 'script', 'find-release.js')
    release_info = execute(['node', script_path, version])
    release = json.loads(release_info)
    return release
Exemplo n.º 39
0
def tag_version(version):
    execute(['git', 'commit', '-a', '-m', 'Bump v{0}.'.format(version)])
    execute(['git', 'tag', 'v{0}'.format(version)])
Exemplo n.º 40
0
def strip_binary(binary_path):
    if get_target_arch() == 'arm':
        strip = 'arm-linux-gnueabihf-strip'
    else:
        strip = 'strip'
    execute([strip, binary_path])
Exemplo n.º 41
0
def call_cpplint(files):
  if files:
    cpplint = cpplint_path()
    execute([sys.executable, cpplint] + list(files))
Exemplo n.º 42
0
def find_changed_files():
  return set(execute(['git', 'diff', '--name-only']).splitlines())
Exemplo n.º 43
0
def get_release(version):
    script_path = os.path.join(ELECTRON_DIR, 'script', 'release',
                               'find-github-release.js')
    release_info = execute(['node', script_path, version])
    release = json.loads(release_info)
    return release
Exemplo n.º 44
0
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(), PLATFORM, 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
        ])
Exemplo n.º 45
0
def force_build():
    build = os.path.join(SOURCE_ROOT, 'script', 'build.py')
    execute([sys.executable, build, '-c', 'Release'])