Example #1
0
def create_symbols_zip():
    dist_name = '{0}-{1}-{2}-{3}-symbols.zip'.format(PROJECT_NAME,
                                                     ELECTRON_VERSION,
                                                     get_platform_key(),
                                                     get_target_arch())
    zip_file = os.path.join(DIST_DIR, dist_name)
    licenses = ['LICENSE', 'LICENSES.chromium.html', 'version']

    with scoped_cwd(DIST_DIR):
        dirs = ['{0}.breakpad.syms'.format(PROJECT_NAME)]
        make_zip(zip_file, licenses, dirs)

    if PLATFORM == 'darwin':
        dsym_name = '{0}-{1}-{2}-{3}-dsym.zip'.format(PROJECT_NAME,
                                                      ELECTRON_VERSION,
                                                      get_platform_key(),
                                                      get_target_arch())
        with scoped_cwd(DIST_DIR):
            dsyms = glob.glob('*.dSYM')
            make_zip(os.path.join(DIST_DIR, dsym_name), licenses, dsyms)
    elif PLATFORM == 'win32':
        pdb_name = '{0}-{1}-{2}-{3}-pdb.zip'.format(PROJECT_NAME,
                                                    ELECTRON_VERSION,
                                                    get_platform_key(),
                                                    get_target_arch())
        with scoped_cwd(DIST_DIR):
            pdbs = glob.glob('*.pdb')
            make_zip(os.path.join(DIST_DIR, pdb_name), pdbs + licenses, [])
Example #2
0
def create_symbols_zip():
  dist_name = '{0}-{1}-{2}-{3}-symbols.zip'.format(PROJECT_NAME,
                                                   ELECTRON_VERSION,
                                                   get_platform_key(),
                                                   get_target_arch())
  zip_file = os.path.join(DIST_DIR, dist_name)
  licenses = ['LICENSE', 'LICENSES.chromium.html', 'version']

  with scoped_cwd(DIST_DIR):
    dirs = ['{0}.breakpad.syms'.format(PROJECT_NAME)]
    make_zip(zip_file, licenses, dirs)

  if PLATFORM == 'darwin':
    dsym_name = '{0}-{1}-{2}-{3}-dsym.zip'.format(PROJECT_NAME,
                                                  ELECTRON_VERSION,
                                                  get_platform_key(),
                                                  get_target_arch())
    with scoped_cwd(DIST_DIR):
      dsyms = glob.glob('*.dSYM')
      make_zip(os.path.join(DIST_DIR, dsym_name), licenses, dsyms)
  elif PLATFORM == 'win32':
    pdb_name = '{0}-{1}-{2}-{3}-pdb.zip'.format(PROJECT_NAME,
                                                ELECTRON_VERSION,
                                                get_platform_key(),
                                                get_target_arch())
    with scoped_cwd(DIST_DIR):
      pdbs = glob.glob('*.pdb')
      make_zip(os.path.join(DIST_DIR, pdb_name), pdbs + licenses, [])
Example #3
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])
Example #4
0
def create_dist_zip():
    dist_name = "{0}-{1}-{2}-{3}.zip".format(PROJECT_NAME, ATOM_SHELL_VERSION, get_platform_key(), get_target_arch())
    zip_file = os.path.join(SOURCE_ROOT, "dist", dist_name)

    with scoped_cwd(DIST_DIR):
        files = TARGET_BINARIES[PLATFORM] + ["LICENSE", "LICENSES.chromium.html", "version"]
        dirs = TARGET_DIRECTORIES[PLATFORM]
        make_zip(zip_file, files, dirs)
Example #5
0
def create_symbols_zip():
    dist_name = "{0}-{1}-{2}-{3}-symbols.zip".format(
        PROJECT_NAME, ATOM_SHELL_VERSION, get_platform_key(), get_target_arch()
    )
    zip_file = os.path.join(DIST_DIR, dist_name)
    licenses = ["LICENSE", "LICENSES.chromium.html", "version"]

    with scoped_cwd(DIST_DIR):
        dirs = ["{0}.breakpad.syms".format(PROJECT_NAME)]
        make_zip(zip_file, licenses, dirs)

    if PLATFORM == "darwin":
        dsym_name = "{0}-{1}-{2}-{3}-dsym.zip".format(
            PROJECT_NAME, ATOM_SHELL_VERSION, get_platform_key(), get_target_arch()
        )
        with scoped_cwd(DIST_DIR):
            dsyms = glob.glob("*.dSYM")
            make_zip(os.path.join(DIST_DIR, dsym_name), licenses, dsyms)
Example #6
0
def get_zip_name(name, version, target_arch, suffix=''):
    arch = 'ia32' if (target_arch == 'x86') else target_arch
    if arch == 'arm':
        arch += 'v7l'
    zip_name = '{0}-{1}-{2}-{3}'.format(name, version, get_platform_key(),
                                        arch)
    if suffix:
        zip_name += '-' + suffix
    return zip_name + '.zip'
def create_symbols_zip():
    dist_name = '{0}-{1}-{2}-{3}-symbols.zip'.format(PROJECT_NAME,
                                                     ATOM_SHELL_VERSION,
                                                     get_platform_key(),
                                                     get_target_arch())
    zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)

    with scoped_cwd(DIST_DIR):
        files = ['LICENSE', 'version']
        dirs = ['{0}.breakpad.syms'.format(PROJECT_NAME)]
        make_zip(zip_file, files, dirs)
Example #8
0
def create_dist_zip():
  dist_name = '{0}-{1}-{2}-{3}.zip'.format(PROJECT_NAME, ELECTRON_VERSION,
                                           get_platform_key(),
                                           get_target_arch())
  zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)

  with scoped_cwd(DIST_DIR):
    files = TARGET_BINARIES[PLATFORM] +  ['LICENSE', 'LICENSES.chromium.html',
                                          'version']
    dirs = TARGET_DIRECTORIES[PLATFORM]
    make_zip(zip_file, files, dirs)
Example #9
0
def create_chrome_binary_zip(binary, version):
    dist_name = "{0}-{1}-{2}-{3}.zip".format(binary, version, get_platform_key(), get_target_arch())
    zip_file = os.path.join(SOURCE_ROOT, "dist", dist_name)

    with scoped_cwd(DIST_DIR):
        files = ["LICENSE", "LICENSES.chromium.html"]
        if PLATFORM == "win32":
            files += [binary + ".exe"]
        else:
            files += [binary]
        make_zip(zip_file, files, [])
Example #10
0
def create_symbols_zip():
  dist_name = '{0}-{1}-{2}-{3}-symbols.zip'.format(PROJECT_NAME,
                                                   ATOM_SHELL_VERSION,
                                                   get_platform_key(),
                                                   get_target_arch())
  zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)

  with scoped_cwd(DIST_DIR):
    files = ['LICENSE', 'version']
    dirs = ['{0}.breakpad.syms'.format(PROJECT_NAME)]
    make_zip(zip_file, files, dirs)
Example #11
0
def create_dist_zip():
  dist_name = '{0}-{1}-{2}-{3}.zip'.format(PROJECT_NAME, ELECTRON_VERSION,
                                           get_platform_key(),
                                           get_target_arch())
  zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)

  with scoped_cwd(DIST_DIR):
    files = TARGET_BINARIES[PLATFORM] +  ['LICENSE', 'LICENSES.chromium.html',
                                          'version']
    dirs = TARGET_DIRECTORIES[PLATFORM]
    make_zip(zip_file, files, dirs)
Example #12
0
def create_chrome_binary_zip(binary, version):
  dist_name = '{0}-{1}-{2}-{3}.zip'.format(binary, version, get_platform_key(),
                                           get_target_arch())
  zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)

  with scoped_cwd(DIST_DIR):
    files = ['LICENSE', 'LICENSES.chromium.html']
    if PLATFORM == 'win32':
      files += [binary + '.exe']
    else:
      files += [binary]
    make_zip(zip_file, files, [])
Example #13
0
def create_dist_zip():
    dist_name = '{0}-{1}-{2}-{3}.zip'.format(PROJECT_NAME, ATOM_SHELL_VERSION,
                                             get_platform_key(),
                                             get_target_arch())
    zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)

    with scoped_cwd(DIST_DIR):
        files = TARGET_BINARIES[PLATFORM] + ['LICENSE', 'version']
        if PLATFORM == 'linux':
            files += [lib for lib in SYSTEM_LIBRARIES if os.path.exists(lib)]
        dirs = TARGET_DIRECTORIES[PLATFORM]
        make_zip(zip_file, files, dirs)
Example #14
0
def create_dist_zip():
  dist_name = '{0}-{1}-{2}-{3}.zip'.format(PROJECT_NAME, ATOM_SHELL_VERSION,
                                           get_platform_key(),
                                           get_target_arch())
  zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)

  with scoped_cwd(DIST_DIR):
    files = TARGET_BINARIES[PLATFORM] +  ['LICENSE', 'version']
    if PLATFORM == 'linux':
      files += [lib for lib in SYSTEM_LIBRARIES if os.path.exists(lib)]
    dirs = TARGET_DIRECTORIES[PLATFORM]
    make_zip(zip_file, files, dirs)
Example #15
0
def create_ffmpeg_zip():
  dist_name = 'ffmpeg-{0}-{1}-{2}.zip'.format(
      ATOM_SHELL_VERSION, get_platform_key(), get_target_arch())
  zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)

  if PLATFORM == 'darwin':
    ffmpeg_name = 'libffmpeg.dylib'
  elif PLATFORM == 'linux':
    ffmpeg_name = 'libffmpeg.so'
  elif PLATFORM == 'win32':
    ffmpeg_name = 'ffmpeg.dll'

  shutil.copy2(os.path.join(CHROMIUM_DIR, '..', 'ffmpeg', ffmpeg_name),
               DIST_DIR)
  with scoped_cwd(DIST_DIR):
    make_zip(zip_file, [ffmpeg_name, 'LICENSE', 'LICENSES.chromium.html'], [])
Example #16
0
def create_ffmpeg_zip():
    dist_name = "ffmpeg-{0}-{1}-{2}.zip".format(ATOM_SHELL_VERSION, get_platform_key(), get_target_arch())
    zip_file = os.path.join(SOURCE_ROOT, "dist", dist_name)

    if PLATFORM == "darwin":
        ffmpeg_name = "libffmpeg.dylib"
    elif PLATFORM == "linux":
        ffmpeg_name = "libffmpeg.so"
    elif PLATFORM == "win32":
        ffmpeg_name = "ffmpeg.dll"

    shutil.copy2(os.path.join(CHROMIUM_DIR, "..", "ffmpeg", ffmpeg_name), DIST_DIR)

    if PLATFORM == "linux":
        strip_binary(os.path.join(DIST_DIR, ffmpeg_name))

    with scoped_cwd(DIST_DIR):
        make_zip(zip_file, [ffmpeg_name, "LICENSE", "LICENSES.chromium.html"], [])
Example #17
0
                     scoped_cwd
from lib.github import GitHub


ATOM_SHELL_REPO = 'brave/electron'
ATOM_SHELL_VERSION = get_atom_shell_version()

PROJECT_NAME = atom_gyp()['project_name%']
PRODUCT_NAME = atom_gyp()['product_name%']

SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R')
DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
DIST_NAME = '{0}-{1}-{2}-{3}.zip'.format(PROJECT_NAME,
                                         ATOM_SHELL_VERSION,
                                         get_platform_key(),
                                         get_target_arch())
SYMBOLS_NAME = '{0}-{1}-{2}-{3}-symbols.zip'.format(PROJECT_NAME,
                                                    ATOM_SHELL_VERSION,
                                                    get_platform_key(),
                                                    get_target_arch())
DSYM_NAME = '{0}-{1}-{2}-{3}-dsym.zip'.format(PROJECT_NAME,
                                              ATOM_SHELL_VERSION,
                                              get_platform_key(),
                                              get_target_arch())
MKSNAPSHOT_NAME = 'mksnapshot-{0}-{1}-{2}.zip'.format(ATOM_SHELL_VERSION,
                                                      get_platform_key(),
                                                      get_target_arch())


def main():
Example #18
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
        ])
Example #19
0
                       get_platform_key
from lib.util import atom_gyp, execute, get_atom_shell_version, parse_version, \
                     scoped_cwd
from lib.github import GitHub

ATOM_SHELL_REPO = 'atom/electron'
ATOM_SHELL_VERSION = get_atom_shell_version()

PROJECT_NAME = atom_gyp()['project_name%']
PRODUCT_NAME = atom_gyp()['product_name%']

SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R')
DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
DIST_NAME = '{0}-{1}-{2}-{3}.zip'.format(PROJECT_NAME, ATOM_SHELL_VERSION,
                                         get_platform_key(), get_target_arch())
SYMBOLS_NAME = '{0}-{1}-{2}-{3}-symbols.zip'.format(PROJECT_NAME,
                                                    ATOM_SHELL_VERSION,
                                                    get_platform_key(),
                                                    get_target_arch())
MKSNAPSHOT_NAME = 'mksnapshot-{0}-{1}-{2}.zip'.format(ATOM_SHELL_VERSION,
                                                      get_platform_key(),
                                                      get_target_arch())


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')
Example #20
0
def main():
    args = parse_args()
    if args.verbose:
        enable_verbose_mode()
    if args.upload_to_s3:
        utcnow = datetime.datetime.utcnow()
        args.upload_timestamp = utcnow.strftime('%Y%m%d')

    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

    tag_exists = False
    release = get_release(args.version)
    if not release['draft']:
        tag_exists = True

    if not args.upload_to_s3:
        assert release['exists'], \
              'Release does not exist; cannot upload to GitHub!'
        assert tag_exists == args.overwrite, \
              'You have to pass --overwrite to overwrite a published release'

    # Upload Electron files.
    # Rename dist.zip to  get_zip_name('electron', version, suffix='')
    electron_zip = os.path.join(OUT_DIR, DIST_NAME)
    shutil.copy2(os.path.join(OUT_DIR, 'dist.zip'), electron_zip)
    upload_electron(release, electron_zip, args)
    if get_target_arch() != 'mips64el':
        symbols_zip = os.path.join(OUT_DIR, SYMBOLS_NAME)
        shutil.copy2(os.path.join(OUT_DIR, 'symbols.zip'), symbols_zip)
        upload_electron(release, symbols_zip, args)
    if PLATFORM == 'darwin':
        if get_platform_key() == 'darwin' and get_target_arch() == 'x64':
            api_path = os.path.join(ELECTRON_DIR, 'electron-api.json')
            upload_electron(release, api_path, args)

            ts_defs_path = os.path.join(ELECTRON_DIR, 'electron.d.ts')
            upload_electron(release, ts_defs_path, args)

        dsym_zip = os.path.join(OUT_DIR, DSYM_NAME)
        shutil.copy2(os.path.join(OUT_DIR, 'dsym.zip'), dsym_zip)
        upload_electron(release, dsym_zip, args)

        dsym_snaphot_zip = os.path.join(OUT_DIR, DSYM_SNAPSHOT_NAME)
        shutil.copy2(os.path.join(OUT_DIR, 'dsym-snapshot.zip'),
                     dsym_snaphot_zip)
        upload_electron(release, dsym_snaphot_zip, args)
    elif PLATFORM == 'win32':
        pdb_zip = os.path.join(OUT_DIR, PDB_NAME)
        shutil.copy2(os.path.join(OUT_DIR, 'pdb.zip'), pdb_zip)
        upload_electron(release, pdb_zip, args)
    elif PLATFORM == 'linux':
        debug_zip = os.path.join(OUT_DIR, DEBUG_NAME)
        shutil.copy2(os.path.join(OUT_DIR, 'debug.zip'), debug_zip)
        upload_electron(release, debug_zip, args)

        # Upload libcxx_objects.zip for linux only
        libcxx_objects = get_zip_name('libcxx-objects', ELECTRON_VERSION)
        libcxx_objects_zip = os.path.join(OUT_DIR, libcxx_objects)
        shutil.copy2(os.path.join(OUT_DIR, 'libcxx_objects.zip'),
                     libcxx_objects_zip)
        upload_electron(release, libcxx_objects_zip, args)

        # Upload headers.zip and abi_headers.zip as non-platform specific
        if get_target_arch() == "x64":
            cxx_headers_zip = os.path.join(OUT_DIR, 'libcxx_headers.zip')
            upload_electron(release, cxx_headers_zip, args)

            abi_headers_zip = os.path.join(OUT_DIR, 'libcxxabi_headers.zip')
            upload_electron(release, abi_headers_zip, args)

    # Upload free version of ffmpeg.
    ffmpeg = get_zip_name('ffmpeg', ELECTRON_VERSION)
    ffmpeg_zip = os.path.join(OUT_DIR, ffmpeg)
    ffmpeg_build_path = os.path.join(SRC_DIR, 'out', 'ffmpeg', 'ffmpeg.zip')
    shutil.copy2(ffmpeg_build_path, ffmpeg_zip)
    upload_electron(release, ffmpeg_zip, args)

    chromedriver = get_zip_name('chromedriver', ELECTRON_VERSION)
    chromedriver_zip = os.path.join(OUT_DIR, chromedriver)
    shutil.copy2(os.path.join(OUT_DIR, 'chromedriver.zip'), chromedriver_zip)
    upload_electron(release, chromedriver_zip, args)

    mksnapshot = get_zip_name('mksnapshot', ELECTRON_VERSION)
    mksnapshot_zip = os.path.join(OUT_DIR, mksnapshot)
    if get_target_arch().startswith('arm') and PLATFORM != 'darwin':
        # Upload the x64 binary for arm/arm64 mksnapshot
        mksnapshot = get_zip_name('mksnapshot', ELECTRON_VERSION, 'x64')
        mksnapshot_zip = os.path.join(OUT_DIR, mksnapshot)

    shutil.copy2(os.path.join(OUT_DIR, 'mksnapshot.zip'), mksnapshot_zip)
    upload_electron(release, mksnapshot_zip, args)

    if PLATFORM == 'linux' and get_target_arch() == 'x64':
        # Upload the hunspell dictionaries only from the linux x64 build
        hunspell_dictionaries_zip = os.path.join(OUT_DIR,
                                                 'hunspell_dictionaries.zip')
        upload_electron(release, hunspell_dictionaries_zip, args)

    if not tag_exists and not args.upload_to_s3:
        # Upload symbols to symbol server.
        run_python_upload_script('upload-symbols.py')
        if PLATFORM == 'win32':
            run_python_upload_script('upload-node-headers.py', '-v',
                                     args.version)

    if PLATFORM == 'win32':
        toolchain_profile_zip = os.path.join(OUT_DIR, TOOLCHAIN_PROFILE_NAME)
        with ZipFile(toolchain_profile_zip, 'w') as myzip:
            myzip.write(
                os.path.join(OUT_DIR, 'windows_toolchain_profile.json'),
                'toolchain_profile.json')
        upload_electron(release, toolchain_profile_zip, args)

    return 0
Example #21
0
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, DSYM_NAME))
  elif PLATFORM == 'win32':
    upload_electron(github, release, os.path.join(DIST_DIR, PDB_NAME))

  # Upload free version of ffmpeg.
  ffmpeg = 'ffmpeg-{0}-{1}-{2}.zip'.format(
      ELECTRON_VERSION, get_platform_key(), get_target_arch())
  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 = 'chromedriver-{0}-{1}-{2}.zip'.format(
        get_chromedriver_version(), get_platform_key(), get_target_arch())
    upload_electron(github, release, os.path.join(DIST_DIR, chromedriver))
    mksnapshot = 'mksnapshot-{0}-{1}-{2}.zip'.format(
        ELECTRON_VERSION, get_platform_key(), get_target_arch())
    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)
Example #22
0
                     scoped_cwd
from lib.github import GitHub


ATOM_SHELL_REPO = 'atom/electron'
ATOM_SHELL_VERSION = get_atom_shell_version()

PROJECT_NAME = atom_gyp()['project_name%']
PRODUCT_NAME = atom_gyp()['product_name%']

SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R')
DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
DIST_NAME = '{0}-{1}-{2}-{3}.zip'.format(PROJECT_NAME,
                                         ATOM_SHELL_VERSION,
                                         get_platform_key(),
                                         get_target_arch())
SYMBOLS_NAME = '{0}-{1}-{2}-{3}-symbols.zip'.format(PROJECT_NAME,
                                                    ATOM_SHELL_VERSION,
                                                    get_platform_key(),
                                                    get_target_arch())
DSYM_NAME = '{0}-{1}-{2}-{3}-dsym.zip'.format(PROJECT_NAME,
                                              ATOM_SHELL_VERSION,
                                              get_platform_key(),
                                              get_target_arch())
MKSNAPSHOT_NAME = 'mksnapshot-{0}-{1}-{2}.zip'.format(ATOM_SHELL_VERSION,
                                                      get_platform_key(),
                                                      get_target_arch())


def main():
Example #23
0
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, DSYM_NAME))
    elif PLATFORM == 'win32':
        upload_electron(github, release, os.path.join(DIST_DIR, PDB_NAME))

    # Upload free version of ffmpeg.
    ffmpeg = 'ffmpeg-{0}-{1}-{2}.zip'.format(ELECTRON_VERSION,
                                             get_platform_key(),
                                             get_target_arch())
    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 = 'chromedriver-{0}-{1}-{2}.zip'.format(
            get_chromedriver_version(), get_platform_key(), get_target_arch())
        upload_electron(github, release, os.path.join(DIST_DIR, chromedriver))
        mksnapshot = 'mksnapshot-{0}-{1}-{2}.zip'.format(
            ELECTRON_VERSION, get_platform_key(), get_target_arch())
        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)