Publish GitHub release as record.
769106
def publish(self):
        """"""
        with db.session.begin_nested():
            deposit = self.deposit_class.create(self.metadata)
            deposit['_deposit']['created_by'] = self.event.user_id
            deposit['_deposit']['owners'] = [self.event.user_id]

            # Fetch the deposit files
            for key, url in self.files:
                deposit.files[key] = self.gh.api.session.get(
                    url, stream=True).raw

            deposit.publish()
            recid, record = deposit.fetch_published()
            self.model.recordmetadata = record.model
842726
def publish_post(self):
        
        payload = {'content': self.content_base64.decode('utf-8')}

        sha_blob = self.get_sha_blob()
        if sha_blob:
            commit_msg = 'ghPublish UPDATE: {}'.format(self.title)
            payload.update(sha=sha_blob)
            payload.update(message=commit_msg)
        else:
            commit_msg = 'ghPublish ADD: {}'.format(self.title)
            payload.update(message=commit_msg)

        r = requests.put(self.api_url,
                         auth=self.get_auth_details(),
                         data=json.dumps(payload))
        try:
            url = r.json()['content']['html_url']
            return r.status_code, url
        except KeyError:
            return r.status_code, None
274361
def online(note, github_repository, github_username):
    """"""
    callbacks.git_installed()
    try:
        repo = git.Repo()
    except git.InvalidGitRepositoryError:
        LOGGER.critical(
            "'memote online' requires a git repository in order to follow "
            "the current branch's commit history.")
        sys.exit(1)
    if note == "memote-ci access":
        note = "{} to {}".format(note, github_repository)

    # Github API calls
    # Set up the git repository on GitHub via API v3.
    gh_repo_name, auth_token, repo_access_token = _setup_gh_repo(
        github_repository,
        github_username,
        note
    )

    # Travis API calls
    # Configure Travis CI to use Github auth token then return encrypted token.
    secret = _setup_travis_ci(gh_repo_name, auth_token, repo_access_token)

    # Save the encrypted token in the travis config then commit and push
    LOGGER.info("Storing GitHub token in '.travis.yml'.")
    config = te.load_travis_configuration(".travis.yml")
    global_env = config.setdefault("env", {}).get("global")
    if global_env is None:
        config["env"]["global"] = global_env = {}
    try:
        global_env["secure"] = secret
    except TypeError:
        global_env.append({"secure": secret})
    te.dump_travis_configuration(config, ".travis.yml")
    LOGGER.info("Add, commit and push changes to '.travis.yml' to GitHub.")
    repo.index.add([".travis.yml"])
    check_call(
      ['git', 'commit', '-m', "chore: add encrypted GitHub access token"]
    )
    check_call(
      ['git', 'push', '--set-upstream', 'origin', repo.active_branch.name]
    )
658974
def publish(self, distribution, storage=""):
        
        try:
            return self._publishes[distribution]
        except KeyError:
            self._publishes[distribution] = Publish(self.client, distribution, timestamp=self.timestamp, storage=(storage or self.storage))
            return self._publishes[distribution]
762234
function tagRepo(version) {
    if (SHOULD_PUBLISH) {
        shell.exec(`git tag ${version}`);
        shell.exec("git push origin --tags");
    } else {
        console.log(`\n\nWould publish git tag as version ${version}.`);
    }
}
35683
def mkrelease(finish='yes', version=''):
    
    if not version:
        version = _version_format(_version_guess_next())

    if _git_get_current_branch() != 'release/' + version:
        _tool_run('git checkout develop',
                  'git flow release start ' + version)

    _project_patch_version(version)
    _project_patch_changelog()
    patched_files = ' '.join([VERSION_FILE, CHANGES_FILE])

    run('git diff ' + patched_files, pty=True)
    _tool_run(('git commit -m "Bump Version to {0!s}" {1!s}'
               .format(version, patched_files)))

    if finish not in ('no', 'n', ):
        _tool_run("git flow release finish -m '{0}' {0}".format(version),
                  env={b'GIT_MERGE_AUTOEDIT': b'no', })
        _tool_run('git push origin --tags develop master')
1272078
def release():
    

    if not is_working_tree_clean():
        print('Your working tree is not clean. Refusing to create a release.')
        return

    print('Rebuilding the AUTHORS file to check for modifications...')
    authors()

    if not is_working_tree_clean():
        print('Your working tree is not clean after the AUTHORS file was '
              'rebuilt.')
        print('Please commit the changes before continuing.')
        return

    if not is_manifest_up_to_date():
        print('Manifest is not up to date.')
        print('Please update MANIFEST.in or remove spurious files.')
        return

    # Get version
    version = 'v{}'.format(local('python setup.py --version', capture=True))
    name = local('python setup.py --name', capture=True)

    # Tag
    tag_message = '{} release version {}.'.format(name, version)

    print('----------------------')
    print('Proceeding will tag the release, push the repository upstream,')
    print('and release a new version on PyPI.')
    print()
    print('Version: {}'.format(version))
    print('Tag message: {}'.format(tag_message))
    print()
    if not confirm('Continue?', default=True):
        print('Aborting.')
        return

    local('git tag -a {} -m {}'.format(pipes.quote(version),
                                       pipes.quote(tag_message)))

    # Push
    local('git push --tags origin develop')

    # Package and upload to pypi
    local('python setup.py sdist bdist_wheel upload')
1232312
function release(type) {
    target.test();
    exec("npm version " + type);
    target.changelog();
    exec("git push origin master --tags");
    exec("npm publish");
}
569724
def prepare_release(ver=None):
    """"""
    write_changelog(True)
    if ver is None:
        ver = next_release()
    print('saving updates to ChangeLog')
    run('git commit ChangeLog -m "[RELEASE] Update to version v{}"'.format(ver), hide=True)
    sha = run('git log -1 --pretty=format:"%h"', hide=True).stdout
    run('git tag -a "{ver}" -m "version {ver}" {sha}'.format(ver=ver, sha=sha), hide=True)
    package()
    write_changelog()
    run('git tag -d {}'.format(ver), hide=True)
    run('git commit --all --amend --no-edit', hide=True)
512555
def release(ctx, yes, latest):
    
    m = RepoManager(ctx.obj['agile'])
    api = m.github_repo()
    if latest:
        latest = api.releases.latest()
        if latest:
            click.echo(latest['tag_name'])
    elif m.can_release('sandbox'):
        branch = m.info['branch']
        version = m.validate_version()
        name = 'v%s' % version
        body = ['Release %s from agiletoolkit' % name]
        data = dict(
            tag_name=name,
            target_commitish=branch,
            name=name,
            body='\n\n'.join(body),
            draft=False,
            prerelease=False
        )
        if yes:
            data = api.releases.create(data=data)
            m.message('Successfully created a new Github release')
        click.echo(niceJson(data))
    else:
        click.echo('skipped')
127486
def publish(self, publications, jar, entry, repo, published):
    """"""

    try:
      ivy = Bootstrapper.default_ivy()
    except Bootstrapper.Error as e:
      raise TaskError('Failed to push {0}! {1}'.format(pushdb_coordinate(jar, entry), e))

    path = repo.get('path')
    ivysettings = self.generate_ivysettings(ivy, published, publish_local=path)

    version = entry.version().version()
    ivyxml = self.generate_ivy(jar, version, publications)

    resolver = repo['resolver']
    args = [
      '-settings', ivysettings,
      '-ivy', ivyxml,

      # Without this setting, the ivy.xml is delivered to the CWD, littering the workspace.  We
      # don't need the ivy.xml, so just give it path under the workdir we won't use.
      '-deliverto', ivyxml + '.unused',

      '-publish', resolver,
      '-publishpattern', '{}/[organisation]/[module]/'
                         '[artifact]-[revision](-[classifier]).[ext]'.format(self.workdir),
      '-revision', version,
      '-m2compatible',
    ]

    # TODO(John Sirois): global logging options should be hidden behind some sort of log manager
    # that we can:
    # a.) obtain a handle to (dependency injection or manual plumbing)
    # b.) query for log detail, ie: `if log_manager.is_verbose:`
    if self.get_options().level == 'debug':
      args.append('-verbose')

    if self.local_snapshot:
      args.append('-overwrite')

    try:
      jvm_options = self._ivy_jvm_options(repo)
      ivy.execute(jvm_options=jvm_options, args=args,
                  workunit_factory=self.context.new_workunit, workunit_name='ivy-publish')
    except Ivy.Error as e:
      raise TaskError('Failed to push {0}! {1}'.format(pushdb_coordinate(jar, entry), e))
1151038
def publish(self, key, data):
        '''
        
        '''
        publish_data = {key: data}
        self.handler.send(salt.utils.json.dumps(publish_data), False)
204446
def publish_repo(self, repo, env):
        
        _r = self.connectors[env].post('/repositories/%s-%s/actions/publish/' % (repo, env), {'id': 'yum_distributor'})
        if _r.status_code != Constants.PULP_POST_ACCEPTED:
            _r.raise_for_status()
        else:
            juicer.utils.Log.log_info("`%s` published in `%s`" % (repo, env))
79862
function github(url, destination) {
  return new Promise((resolve, reject) => {
    (0, _downloadGithubRepo2.default)(url, destination, err => {
      if (err) {
        reject(err);
      } else {
        resolve();
      }
    });
  });
}
1275928
def _handle_github(self):
        """"""
        value = click.prompt(
            _BUG + click.style(
                '1. Open an issue by typing "open";\n',
                fg='green',
            ) + click.style(
                '2. Print human-readable information by typing '
                '"print";\n',
                fg='yellow',
            ) + click.style(
                '3. See the full traceback without submitting details '
                '(default: "ignore").\n\n',
                fg='red',
            ) + 'Please select an action by typing its name',
            type=click.Choice([
                'open',
                'print',
                'ignore',
            ], ),
            default='ignore',
        )
        getattr(self, '_process_' + value)()
1002998
def upload(ctx, yes=False):
    """"""
    import callee
    version = callee.__version__

    # check the packages version
    # TODO: add a 'release' to automatically bless a version as release one
    if version.endswith('-dev'):
        fatal("Can't upload a development version (%s) to PyPI!", version)

    # run the upload if it has been confirmed by the user
    if not yes:
        answer = input("Do you really want to upload to PyPI [y/N]? ")
        yes = answer.strip().lower() == 'y'
    if not yes:
        logging.warning("Aborted -- not uploading to PyPI.")
        return -2

    logging.debug("Uploading version %s to PyPI...", version)
    setup_py_upload = ctx.run('python setup.py sdist upload')
    if not setup_py_upload.ok:
        fatal("Failed to upload version %s to PyPI!", version,
              cause=setup_py_upload)
    logging.info("PyPI upload completed successfully.")

    # add a Git tag and push
    git_tag = ctx.run('git tag %s' % version)
    if not git_tag.ok:
        fatal("Failed to add a Git tag for uploaded version %s", version,
              cause=git_tag)
    git_push = ctx.run('git push && git push --tags')
    if not git_push.ok:
        fatal("Failed to push the release upstream.", cause=git_push)
470403
def publish(build):
    
    build.packages.install("wheel")
    build.packages.install("twine")
    build.executables.run([
        "python", "setup.py",
        "sdist", "bdist_wheel", "--universal", "--release"
    ])
    build.executables.run([
        "twine", "upload", "dist/*"
    ])