Beispiel #1
0
def create_chrome_binary_zip(binary, version):
  file_suffix = ''
  create_native_mksnapshot = False
  if binary == 'mksnapshot':
    arch = get_target_arch()
    if arch.startswith('arm'):
      # if the arch is arm/arm64 the mksnapshot executable is an x64 binary,
      # so name it as such.
      file_suffix = 'x64'
      create_native_mksnapshot = True
  dist_name = get_zip_name(binary, version, file_suffix)
  zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)

  files = ['LICENSE', 'LICENSES.chromium.html']
  if PLATFORM == 'win32':
    files += [binary + '.exe']
  else:
    files += [binary]

  with scoped_cwd(DIST_DIR):
    make_zip(zip_file, files, [])

  if create_native_mksnapshot == True:
    # Create a zip with the native version of the mksnapshot binary.
    src = os.path.join(NATIVE_MKSNAPSHOT_DIR, binary)
    dest = os.path.join(DIST_DIR, binary)
    # Copy file and keep the executable bit.
    shutil.copyfile(src, dest)
    os.chmod(dest, os.stat(dest).st_mode | stat.S_IEXEC)

    dist_name = get_zip_name(binary, version)
    zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)
    with scoped_cwd(DIST_DIR):
      make_zip(zip_file, files, [])
def create_chrome_binary_zip(binary, version):
    file_suffix = ''
    create_native_mksnapshot = False
    if binary == 'mksnapshot':
        arch = get_target_arch()
        if arch.startswith('arm'):
            # if the arch is arm/arm64 the mksnapshot executable is an x64 binary,
            # so name it as such.
            file_suffix = 'x64'
            create_native_mksnapshot = True
    dist_name = get_zip_name(binary, version, file_suffix)
    zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)

    files = ['LICENSE', 'LICENSES.chromium.html']
    if PLATFORM == 'win32':
        files += [binary + '.exe']
    else:
        files += [binary]

    with scoped_cwd(DIST_DIR):
        make_zip(zip_file, files, [])

    if create_native_mksnapshot == True:
        # Create a zip with the native version of the mksnapshot binary.
        src = os.path.join(NATIVE_MKSNAPSHOT_DIR, binary)
        dest = os.path.join(DIST_DIR, binary)
        # Copy file and keep the executable bit.
        shutil.copyfile(src, dest)
        os.chmod(dest, os.stat(dest).st_mode | stat.S_IEXEC)

        dist_name = get_zip_name(binary, version)
        zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)
        with scoped_cwd(DIST_DIR):
            make_zip(zip_file, files, [])
Beispiel #3
0
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)
Beispiel #4
0
def main():
  args = parse_args()
  if  args.upload_to_s3:
    utcnow = datetime.datetime.utcnow()
    args.upload_timestamp = utcnow.strftime('%Y%m%d')

  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

  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.
  upload_electron(release, os.path.join(DIST_DIR, DIST_NAME), args)
  if get_target_arch() != 'mips64el':
    upload_electron(release, os.path.join(DIST_DIR, SYMBOLS_NAME), args)
  if PLATFORM == 'darwin':
    upload_electron(release, os.path.join(DIST_DIR, 'electron-api.json'), args)
    upload_electron(release, os.path.join(DIST_DIR, 'electron.d.ts'), args)
    upload_electron(release, os.path.join(DIST_DIR, DSYM_NAME), args)
  elif PLATFORM == 'win32':
    upload_electron(release, os.path.join(DIST_DIR, PDB_NAME), args)

  # Upload free version of ffmpeg.
  ffmpeg = get_zip_name('ffmpeg', ELECTRON_VERSION)
  upload_electron(release, os.path.join(DIST_DIR, ffmpeg), args)

  chromedriver = get_zip_name('chromedriver', ELECTRON_VERSION)
  upload_electron(release, os.path.join(DIST_DIR, chromedriver), args)
  mksnapshot = get_zip_name('mksnapshot', ELECTRON_VERSION)
  upload_electron(release, os.path.join(DIST_DIR, mksnapshot), args)

  if get_target_arch().startswith('arm'):
    # Upload the x64 binary for arm/arm64 mksnapshot
    mksnapshot = get_zip_name('mksnapshot', ELECTRON_VERSION, 'x64')
    upload_electron(release, os.path.join(DIST_DIR, mksnapshot), args)

  if not tag_exists and not args.upload_to_s3:
    # Upload symbols to symbol server.
    run_python_script('upload-symbols.py')
    if PLATFORM == 'win32':
      # Upload node headers.
      run_python_script('create-node-headers.py', '-v', args.version)
      run_python_script('upload-node-headers.py', '-v', args.version)
Beispiel #5
0
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.
  run_python_script('upload-node-headers.py', '-v', args.version)
Beispiel #6
0
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.
  run_python_script('upload-node-headers.py', '-v', args.version)
Beispiel #7
0
def create_dist_zip():
    dist_name = get_zip_name(PROJECT_NAME, ELECTRON_VERSION)
    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)
Beispiel #8
0
def create_dist_zip():
  dist_name = get_zip_name(PROJECT_NAME, ELECTRON_VERSION)
  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)
Beispiel #9
0
def create_symbols_zip():
    dist_name = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, "symbols")
    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 = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, "dsym")
        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 = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, "pdb")
        with scoped_cwd(DIST_DIR):
            pdbs = glob.glob("*.pdb")
            make_zip(os.path.join(DIST_DIR, pdb_name), pdbs + licenses, [])
Beispiel #10
0
def create_symbols_zip():
  dist_name = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'symbols')
  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 = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'dsym')
    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 = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'pdb')
    with scoped_cwd(DIST_DIR):
      pdbs = glob.glob('*.pdb')
      make_zip(os.path.join(DIST_DIR, pdb_name), pdbs + licenses, [])
Beispiel #11
0
def create_symbols_zip():
    dist_name = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'symbols')
    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 = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'dsym')
        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 = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'pdb')
        with scoped_cwd(DIST_DIR):
            pdbs = glob.glob('*.pdb')
            make_zip(os.path.join(DIST_DIR, pdb_name), pdbs + licenses, [])
Beispiel #12
0
def create_dist_zip():
  dist_name = get_zip_name(PROJECT_NAME, ELECTRON_VERSION)
  zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)

  with scoped_cwd(DIST_DIR):
    files = TARGET_BINARIES[PLATFORM] + TARGET_BINARIES_EXT + ['LICENSE',
            'LICENSES.chromium.html', 'version']
    if PLATFORM != 'darwin' and PDF_VIEWER_ENABLED:
      files += ['pdf_viewer_resources.pak']
    dirs = TARGET_DIRECTORIES[PLATFORM]
    make_zip(zip_file, files, dirs)
Beispiel #13
0
def create_dist_zip():
  dist_name = get_zip_name(PROJECT_NAME, ELECTRON_VERSION)
  zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)

  with scoped_cwd(DIST_DIR):
    files = TARGET_BINARIES[PLATFORM] + TARGET_BINARIES_EXT + ['LICENSE',
            'LICENSES.chromium.html', 'version']
    if PLATFORM != 'darwin' and PDF_VIEWER_ENABLED:
      files += ['pdf_viewer_resources.pak']
    dirs = TARGET_DIRECTORIES[PLATFORM]
    make_zip(zip_file, files, dirs)
Beispiel #14
0
def create_chrome_binary_zip(binary, version):
    dist_name = get_zip_name(binary, version)
    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, [])
Beispiel #15
0
def create_chrome_binary_zip(binary, version):
  dist_name = get_zip_name(binary, version)
  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, [])
Beispiel #16
0
def create_chrome_binary_zip(binary, version):
    dist_name = get_zip_name(binary, version)
    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, [])
Beispiel #17
0
def create_ffmpeg_zip():
    dist_name = get_zip_name("ffmpeg", ELECTRON_VERSION)
    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"], [])
Beispiel #18
0
def create_ffmpeg_zip():
  dist_name = get_zip_name('ffmpeg', ELECTRON_VERSION)
  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'], [])
Beispiel #19
0
def create_ffmpeg_zip():
  dist_name = get_zip_name('ffmpeg', ELECTRON_VERSION)
  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'], [])
Beispiel #20
0
import requests
import re
import shutil
import subprocess
import sys
import tempfile

from lib.config import (PLATFORM, get_target_arch, get_env_var, get_zip_name,
                        product_name, project_name, SOURCE_ROOT, dist_dir,
                        output_dir, get_brave_version, get_raw_version)
from lib.util import execute, parse_version, scoped_cwd, s3put
from lib.helpers import *

from lib.github import GitHub

DIST_NAME = get_zip_name(project_name(), get_brave_version())
SYMBOLS_NAME = get_zip_name(project_name(), get_brave_version(), 'symbols')
DSYM_NAME = get_zip_name(project_name(), get_brave_version(), 'dsym')
PDB_NAME = get_zip_name(project_name(), get_brave_version(), 'pdb')

if os.environ.get('DEBUG_HTTP_HEADERS') == 'true':
    try:
        from http.client import HTTPConnection  # python3
    except ImportError:
        from httplib import HTTPConnection  # python2


def main():
    args = parse_args()
    print('[INFO] Running upload...')
Beispiel #21
0
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])
Beispiel #22
0
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')
Beispiel #23
0
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)

  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 get_target_arch().startswith('arm'):
    # Upload the x64 binary for arm/arm64 mksnapshot
    mksnapshot = get_zip_name('mksnapshot', ELECTRON_VERSION, 'x64')
    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)
Beispiel #24
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,
                    '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)
Beispiel #25
0
from lib.config import PLATFORM, get_target_arch,  get_env_var, s3_config, \
                       get_zip_name
from lib.util import get_electron_branding, execute, get_electron_version, \
                     s3put, get_electron_exec, get_out_dir, \
                     SRC_DIR, ELECTRON_DIR


ELECTRON_REPO = 'electron/electron'
ELECTRON_VERSION = get_electron_version()

PROJECT_NAME = get_electron_branding()['project_name']
PRODUCT_NAME = get_electron_branding()['product_name']

OUT_DIR = get_out_dir()

DIST_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION)
SYMBOLS_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'symbols')
DSYM_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'dsym')
PDB_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'pdb')
DEBUG_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'debug')
TOOLCHAIN_PROFILE_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'toolchain-profile')


def main():
  args = parse_args()
  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):
Beispiel #26
0
                       get_zip_name
from lib.util import electron_gyp, execute, get_electron_version, \
                     parse_version, scoped_cwd, s3put
from lib.github import GitHub

ELECTRON_REPO = 'electron/electron'
ELECTRON_VERSION = get_electron_version()

PROJECT_NAME = electron_gyp()['project_name%']
PRODUCT_NAME = electron_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 = get_zip_name(PROJECT_NAME, ELECTRON_VERSION)
SYMBOLS_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'symbols')
DSYM_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'dsym')
PDB_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'pdb')


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(
Beispiel #27
0
                       get_zip_name
from lib.util import get_electron_branding, execute, get_electron_version, \
                     scoped_cwd, s3put, get_electron_exec, \
                     get_out_dir, SRC_DIR


ELECTRON_REPO = 'electron/electron'
ELECTRON_VERSION = get_electron_version()

PROJECT_NAME = get_electron_branding()['project_name']
PRODUCT_NAME = get_electron_branding()['product_name']

SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
OUT_DIR = get_out_dir()

DIST_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION)
SYMBOLS_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'symbols')
DSYM_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'dsym')
PDB_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'pdb')


def main():
  args = parse_args()
  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)
Beispiel #28
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
Beispiel #29
0
from zipfile import ZipFile
from lib.config import PLATFORM, get_target_arch,s3_config, \
                       get_zip_name, enable_verbose_mode, get_platform_key
from lib.util import get_electron_branding, execute, get_electron_version, \
                     s3put, get_electron_exec, get_out_dir, \
                     SRC_DIR, ELECTRON_DIR, TS_NODE

ELECTRON_VERSION = get_electron_version()

PROJECT_NAME = get_electron_branding()['project_name']
PRODUCT_NAME = get_electron_branding()['product_name']

OUT_DIR = get_out_dir()

DIST_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION)
SYMBOLS_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'symbols')
DSYM_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'dsym')
DSYM_SNAPSHOT_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION,
                                  'dsym-snapshot')
PDB_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'pdb')
DEBUG_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'debug')
TOOLCHAIN_PROFILE_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION,
                                      'toolchain-profile')
CXX_OBJECTS_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION,
                                'libcxx_objects')


def main():
    args = parse_args()
    if args.verbose:
Beispiel #30
0
from lib.config import PLATFORM, get_target_arch, get_chromedriver_version, get_env_var, s3_config, get_zip_name
from lib.util import electron_gyp, execute, get_electron_version, parse_version, scoped_cwd, s3put
from lib.github import GitHub


ELECTRON_REPO = "electron/electron"
ELECTRON_VERSION = get_electron_version()

PROJECT_NAME = electron_gyp()["project_name%"]
PRODUCT_NAME = electron_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 = get_zip_name(PROJECT_NAME, ELECTRON_VERSION)
SYMBOLS_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, "symbols")
DSYM_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, "dsym")
PDB_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, "pdb")


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)
Beispiel #31
0
def main():
    args = parse_args()
    if args.upload_to_s3:
        utcnow = datetime.datetime.utcnow()
        args.upload_timestamp = utcnow.strftime('%Y-%m-%d_%H:%M:%S')

    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
    release = None
    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)
    elif release is None:
        release = dict(tag_name=args.version)

    # Upload Electron with GitHub Releases API.
    upload_electron(github, release, os.path.join(DIST_DIR, DIST_NAME), args)
    if get_target_arch() != 'mips64el':
        upload_electron(github, release, os.path.join(DIST_DIR, SYMBOLS_NAME),
                        args)
    if PLATFORM == 'darwin':
        upload_electron(github, release,
                        os.path.join(DIST_DIR, 'electron-api.json'), args)
        upload_electron(github, release, os.path.join(DIST_DIR,
                                                      'electron.d.ts'), args)
        upload_electron(github, release, os.path.join(DIST_DIR, DSYM_NAME),
                        args)
    elif PLATFORM == 'win32':
        upload_electron(github, release, os.path.join(DIST_DIR, PDB_NAME),
                        args)

    # Upload free version of ffmpeg.
    ffmpeg = get_zip_name('ffmpeg', ELECTRON_VERSION)
    upload_electron(github, release, os.path.join(DIST_DIR, ffmpeg), args)

    chromedriver = get_zip_name('chromedriver', ELECTRON_VERSION)
    upload_electron(github, release, os.path.join(DIST_DIR, chromedriver),
                    args)
    mksnapshot = get_zip_name('mksnapshot', ELECTRON_VERSION)
    upload_electron(github, release, os.path.join(DIST_DIR, mksnapshot), args)

    if get_target_arch().startswith('arm'):
        # Upload the x64 binary for arm/arm64 mksnapshot
        mksnapshot = get_zip_name('mksnapshot', ELECTRON_VERSION, 'x64')
        upload_electron(github, release, os.path.join(DIST_DIR, mksnapshot),
                        args)

    if not tag_exists and not args.upload_to_s3:
        # Upload symbols to symbol server.
        run_python_script('upload-symbols.py')
        if PLATFORM == 'win32':
            # Upload node headers.
            run_python_script('create-node-headers.py', '-v', args.version)
            run_python_script('upload-node-headers.py', '-v', args.version)
Beispiel #32
0
import subprocess
import sys
import tempfile

from io import StringIO
from lib.config import PLATFORM, DIST_URL, get_target_arch, get_chromedriver_version, \
                       get_env_var, s3_config, get_zip_name, product_name, project_name, \
                       SOURCE_ROOT, dist_dir, get_electron_version
from lib.util import execute, parse_version, scoped_cwd, s3put

from lib.github import GitHub


ELECTRON_REPO = "brave/electron"

DIST_NAME = get_zip_name(project_name(), get_electron_version())
SYMBOLS_NAME = get_zip_name(project_name(), get_electron_version(), 'symbols')
DSYM_NAME = get_zip_name(project_name(), get_electron_version(), 'dsym')
PDB_NAME = get_zip_name(project_name(), get_electron_version(), 'pdb')


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()
Beispiel #33
0
def main():
  args = parse_args()
  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':
    api_path = os.path.join(SOURCE_ROOT, 'electron-api.json')
    upload_electron(release, api_path, args)

    ts_defs_path = os.path.join(SOURCE_ROOT, '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)
  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)

  # 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'):
    # Upload the native mksnapshot as mksnapshot.zip
    shutil.copy2(os.path.join(SRC_DIR, 'out', 'native_mksnapshot',
                              'mksnapshot.zip'), mksnapshot_zip)
    upload_electron(release, mksnapshot_zip, args)
    # 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 not tag_exists and not args.upload_to_s3:
    # Upload symbols to symbol server.
    run_python_script('upload-symbols.py')
    if PLATFORM == 'win32':
      run_python_script('upload-node-headers.py', '-v', args.version)
Beispiel #34
0
def main():
    args = parse_args()
    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, 'symobls.zip'), symbols_zip)
        upload_electron(release, symbols_zip, args)
    if PLATFORM == 'darwin':
        api_path = os.path.join(OUT_DIR, 'electron-api.json')
        upload_electron(release, api_path, args)

        ts_defs_path = os.path.join(OUT_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)
    elif PLATFORM == 'win32':
        upload_electron(release, os.path.join(OUT_DIR, PDB_NAME), args)

    # Upload free version of ffmpeg.
    ffmpeg = get_zip_name('ffmpeg', ELECTRON_VERSION)
    ffmpeg_zip = os.path.join(OUT_DIR, ffmpeg)
    shutil.copy2(os.path.join(OUT_DIR, 'ffmpeg.zip'), 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'):
        # Upload the native mksnapshot as mksnapshot.zip
        shutil.copy2(
            os.path.join(GN_SRC_DIR, 'out', 'native_mksnapshot',
                         'native_mksnapshot.zip'), mksnapshot_zip)
        upload_electron(release, mksnapshot_zip, args)
        # 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 not tag_exists and not args.upload_to_s3:
        # Upload symbols to symbol server.
        run_python_script('upload-symbols.py')
        if PLATFORM == 'win32':
            run_python_script('upload-node-headers.py', '-v', args.version)
Beispiel #35
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, '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)
Beispiel #36
0
def main():
    args = parse_args()
    print('[INFO] Running upload...')

    # Enable urllib3 debugging output
    if os.environ.get('DEBUG_HTTP_HEADERS') == 'true':
        logging.basicConfig(level=logging.DEBUG)
        logging.getLogger("urllib3").setLevel(logging.DEBUG)
        logging.debug(
            "DEBUG_HTTP_HEADERS env var is enabled, logging HTTP headers")
        debug_requests_on()

    # ONEVN_REPO is defined in lib/helpers.py for now
    repo = GitHub(get_env_var('GITHUB_TOKEN')).repos(ONEVN_REPO)

    tag = get_onevn_version()
    release = get_release(repo, tag, allow_published_release_updates=False)

    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 Onevn with GitHub Releases API.
    upload_onevn(repo,
                 release,
                 os.path.join(dist_dir(), DIST_NAME),
                 force=args.force)
    upload_onevn(repo,
                 release,
                 os.path.join(dist_dir(), SYMBOLS_NAME),
                 force=args.force)
    # if PLATFORM == 'darwin':
    #     upload_onevn(repo, release, os.path.join(dist_dir(), DSYM_NAME))
    # elif PLATFORM == 'win32':
    #     upload_onevn(repo, release, os.path.join(dist_dir(), PDB_NAME))

    # Upload chromedriver and mksnapshot.
    chromedriver = get_zip_name('chromedriver', get_chromedriver_version())
    upload_onevn(repo,
                 release,
                 os.path.join(dist_dir(), chromedriver),
                 force=args.force)

    pkgs = get_onevn_packages(output_dir(), release_channel(),
                              get_raw_version())

    if PLATFORM == 'darwin':
        for pkg in pkgs:
            upload_onevn(repo,
                         release,
                         os.path.join(output_dir(), pkg),
                         force=args.force)
    elif PLATFORM == 'win32':
        if get_target_arch() == 'x64':
            upload_onevn(repo,
                         release,
                         os.path.join(output_dir(), 'onevn_installer.exe'),
                         'onevn_installer-x64.exe',
                         force=args.force)
            for pkg in pkgs:
                upload_onevn(repo,
                             release,
                             os.path.join(output_dir(), pkg),
                             force=args.force)
        else:
            upload_onevn(repo,
                         release,
                         os.path.join(output_dir(), 'onevn_installer.exe'),
                         'onevn_installer-ia32.exe',
                         force=args.force)
            for pkg in pkgs:
                upload_onevn(repo,
                             release,
                             os.path.join(output_dir(), pkg),
                             force=args.force)
    else:
        if get_target_arch() == 'x64':
            for pkg in pkgs:
                upload_onevn(repo,
                             release,
                             os.path.join(output_dir(), pkg),
                             force=args.force)
        else:
            upload_onevn(repo,
                         release,
                         os.path.join(output_dir(), 'onevn-i386.rpm'),
                         force=args.force)
            upload_onevn(repo,
                         release,
                         os.path.join(output_dir(), 'onevn-i386.deb'),
                         force=args.force)

    # mksnapshot = get_zip_name('mksnapshot', get_onevn_version())
    # upload_onevn(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')

    if os.environ.get('DEBUG_HTTP_HEADERS') == 'true':
        debug_requests_off()
    print('[INFO] Finished upload')