示例#1
0
文件: upload.py 项目: brave/electron
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)
示例#2
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)
示例#3
0
def parse_args():
  parser = argparse.ArgumentParser(description='upload distribution file')
  parser.add_argument('-v', '--version', help='Specify the version',
                      default=get_electron_version())
  parser.add_argument('-p', '--publish-release',
                      help='Publish the release',
                      action='store_true')
  parser.add_argument('-d', '--dist-url',
                      help='The base dist url for download',
                      default=DIST_URL)
  return parser.parse_args()
示例#4
0
文件: upload.py 项目: brave/electron
def parse_args():
  parser = argparse.ArgumentParser(description='upload distribution file')
  parser.add_argument('-v', '--version', help='Specify the version',
                      default=get_electron_version())
  parser.add_argument('-p', '--publish-release',
                      help='Publish the release',
                      action='store_true')
  parser.add_argument('-d', '--dist-url',
                      help='The base dist url for download',
                      default=DIST_URL)
  return parser.parse_args()
示例#5
0
def main():
    if len(sys.argv) != 2 or sys.argv[1] == '-h':
        print 'Usage: bump-version.py [<version> | major | minor | patch]'
        return 1

    option = sys.argv[1]
    increments = ['major', 'minor', 'patch', 'build']
    if option in increments:
        version = get_electron_version()
        versions = parse_version(version.split('-')[0])
        versions = increase_version(versions, increments.index(option))
    else:
        versions = parse_version(option)

    version = '.'.join(versions[:3])

    with scoped_cwd(SOURCE_ROOT):
        update_package_json(version)
        tag_version(version)
示例#6
0
def main():
  if len(sys.argv) != 2 or sys.argv[1] == '-h':
    print 'Usage: bump-version.py [<version> | major | minor | patch]'
    return 1

  option = sys.argv[1]
  increments = ['major', 'minor', 'patch', 'build']
  if option in increments:
    version = get_electron_version()
    versions = parse_version(version.split('-')[0])
    versions = increase_version(versions, increments.index(option))
  else:
    versions = parse_version(option)

  version = '.'.join(versions[:3])

  with scoped_cwd(SOURCE_ROOT):
    update_package_json(version)
    tag_version(version)
示例#7
0
def release_electron_checksums(github, release):
    checksums = run_python_script('merge-electron-checksums.py', '-v',
                                  get_electron_version())
    upload_io_to_github(github, release, 'SHASUMS256.txt',
                        StringIO(checksums.decode('utf-8')), 'text/plain')
示例#8
0
def get_electron_build_version():
    return get_electron_version()
示例#9
0
import shutil
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/muon"

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()
示例#10
0
文件: version.py 项目: brave/electron
def create_version():
  version_path = os.path.join(output_dir(), 'version')
  with open(version_path, 'w') as version_file:
    version_file.write(get_electron_version())
示例#11
0
文件: upload.py 项目: brave/electron
def release_electron_checksums(github, release):
  checksums = run_python_script('merge-electron-checksums.py',
                                '-v', get_electron_version())
  upload_io_to_github(github, release, 'SHASUMS256.txt',
                      StringIO(checksums.decode('utf-8')), 'text/plain')
示例#12
0
文件: upload.py 项目: brave/electron
def get_electron_build_version():
  return get_electron_version()
示例#13
0
文件: upload.py 项目: brave/electron
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()
示例#14
0
文件: version.py 项目: xcesiv/muon
def create_version():
    version_path = os.path.join(output_dir(), 'version')
    with open(version_path, 'w') as version_file:
        version_file.write(get_electron_version())