Create a new release in github
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')
446911
def release():
    

    from secrets import pypi_auth

    # Check that all changes are committed before creating a new version
    git_check()

    # Test package
    test()

    # Increment version
    inc_version()

    # Commit new version, create tag for version and push everything to origin
    git_push()

    # Build and publish package
    build()
    pathname = 'dist/pynb-{}.tar.gz'.format(version.__version__)
    docker_exec('twine upload -u {user} -p {pass} {pathname}'.format(pathname=pathname, **pypi_auth))

    # Remove temporary files
    clean()
459240
function createTag() {
  var newTagName = 'v1.0.0';

  return git.tag({tag: newTagName, message: newTagName + ' release', annotated: true})
      .then(git.push.bind(null, {tag: newTagName, remote: remote}));

}
195901
def _release(self):
        """"""

        pypiconfig = pypi.PypiConfig()

        # Does the user normally want a real release?  We are
        # interested in getting a sane default answer here, so you can
        # override it in the exceptional case but just hit Enter in
        # the usual case.
        main_files = os.listdir(self.data['workingdir'])
        if 'setup.py' not in main_files and 'setup.cfg' not in main_files:
            # Neither setup.py nor setup.cfg, so this is no python
            # package, so at least a pypi release is not useful.
            # Expected case: this is a buildout directory.
            default_answer = False
        else:
            default_answer = pypiconfig.want_release()

        if not utils.ask("Check out the tag (for tweaks or pypi/distutils "
                         "server upload)", default=default_answer):
            return

        package = self.vcs.name
        version = self.data['new_version']
        logger.info("Doing a checkout...")
        self.vcs.checkout_from_tag(version)
        self.data['tagdir'] = os.path.realpath(os.getcwd())
        logger.info("Tag checkout placed in %s", self.data['tagdir'])

        # Possibly fix setup.cfg.
        if self.setup_cfg.has_bad_commands():
            logger.info("This is not advisable for a release.")
            if utils.ask("Fix %s (and commit to tag if possible)" %
                         self.setup_cfg.config_filename, default=True):
                # Fix the setup.cfg in the current working directory
                # so the current release works well.
                self.setup_cfg.fix_config()

        sdist_options = self._sdist_options()

        if 'setup.py' in os.listdir(self.data['tagdir']):
            self._upload_distributions(package, sdist_options, pypiconfig)

        # Make sure we are in the expected directory again.
        os.chdir(self.vcs.workingdir)
412898
def update_release(self, name, message, draft=False, prerelease=False,
                       tag_name=github.GithubObject.NotSet,
                       target_commitish=github.GithubObject.NotSet):
        
        assert tag_name is github.GithubObject.NotSet              \
            or isinstance(tag_name, (str, unicode)),               \
            'tag_name must be a str/unicode object'
        assert target_commitish is github.GithubObject.NotSet      \
            or isinstance(target_commitish, (str, unicode)),       \
            'target_commitish must be a str/unicode object'
        assert isinstance(name, (str, unicode)), name
        assert isinstance(message, (str, unicode)), message
        assert isinstance(draft, bool), draft
        assert isinstance(prerelease, bool), prerelease
        if tag_name is github.GithubObject.NotSet:
            tag_name = self.tag_name
        post_parameters = {
            "tag_name": tag_name,
            "name": name,
            "body": message,
            "draft": draft,
            "prerelease": prerelease,
        }
        # Do not set target_commitish to self.target_commitish when ommited, just don't send it
        # alltogether in that case, in order to match the Github API behaviour. Only send it when set.
        if target_commitish is not github.GithubObject.NotSet:
            post_parameters['target_commitish'] = target_commitish
        headers, data = self._requester.requestJsonAndCheck(
            "PATCH",
            self.url,
            input=post_parameters
        )
        return github.GitRelease.GitRelease(self._requester, headers, data, completed=True)
240968
def make_version(ref=None):
    """"""
    cmd = 'git describe --tags --abbrev=6 {}'.format(ref or '')
    with hide('commands'):
        version = local(cmd, capture=True).strip()
    if re.match('^v[0-9]', version):
        version = version[1:]
    # replacements to match semver.org build numbers
    if '-' in version:
        head, _, tail = version.partition('-')
        count, _, sha = tail.partition('-g')
        version = head + '+' + count + '-' + sha
    return version
1255116
def release():
    """"""
    if check_staged():
        raise EnvironmentError('There are staged changes, abort.')
    if check_unstaged():
        raise EnvironmentError('There are unstaged changes, abort.')
    bump()
    tag()
    build()
    doc_gen()
    puts(colored.yellow("Remember to upload documentation and package:"))
    with indent(2):
        puts(colored.cyan("shovel doc.upload"))
        puts(colored.cyan("shovel version.upload"))
410376
def create_branch(version):
    """"""
    repo = Repo.init(".")
    if repo.is_dirty(untracked_files=True):
        raise RuntimeError(f"Repository is dirty, please commit/stash your changes.")

    branch_name = f"release-{version}"
    print(f"{Fore.CYAN}Create {branch_name} branch from upstream master")
    upstream = get_upstream(repo)
    upstream.fetch()
    release_branch = repo.create_head(branch_name, upstream.refs.master, force=True)
    release_branch.checkout()
    return repo
1079432
def push_new_version(gh_token: str = None, owner: str = None, name: str = None):
    

    check_repo()
    server = 'origin'
    if gh_token:
        server = 'https://{token}@{repo}'.format(
            token=gh_token,
            repo='github.com/{owner}/{name}.git'.format(owner=owner, name=name)
        )

    try:
        repo.git.push(server, 'master')
        repo.git.push('--tags', server, 'master')
    except GitCommandError as error:
        message = str(error)
        if gh_token:
            message = message.replace(gh_token, '[GH_TOKEN]')
        raise GitError(message)
507228
def release():
    ""
    version = run('python setup.py --version').stdout.strip()
    assert version, 'No version found in setup.py?'

    print('### Releasing new version: {0}'.format(version))
    run('git tag {0}'.format(version))
    run('git push --tags')

    run('python setup.py sdist bdist_wheel')
    run('twine upload -s dist/*')
1337447
def release(version):
    
    if version == ".":
        # harvest version number from dirname of repo
        # I remind you, we're in the Misc subdir right now
        version = os.path.basename(root)

    existing_filenames = glob_blurbs(version)
    if existing_filenames:
        error("Sorry, can't handle appending 'next' files to an existing version (yet).")

    output = f("Misc/NEWS.d/{version}.rst")
    filenames = glob_blurbs("next")
    blurbs = Blurbs()
    date = current_date()

    if not filenames:
        print(f("No blurbs found.  Setting {version} as having no changes."))
        body = f("There were no new changes in version {version}.\n")
        metadata = {"no changes": "True", "bpo": "0", "section": "Library", "date": date, "nonce": nonceify(body)}
        blurbs.append((metadata, body))
    else:
        no_changes = None
        count = len(filenames)
        print(f('Merging {count} blurbs to "{output}".'))

        for filename in filenames:
            if not filename.endswith(".rst"):
                continue
            blurbs.load_next(filename)

        metadata = blurbs[0][0]

    metadata['release date'] = date
    print("Saving.")

    blurbs.save(output)
    git_add_files.append(output)
    flush_git_add_files()

    how_many = len(filenames)
    print(f("Removing {how_many} 'next' files from git."))
    git_rm_files.extend(filenames)
    flush_git_rm_files()

    # sanity check: ensuring that saving/reloading the merged blurb file works.
    blurbs2 = Blurbs()
    blurbs2.load(output)
    assert blurbs2 == blurbs, f("Reloading {output} isn't reproducible?!")

    print()
    print("Ready for commit.")
746847
function finishRelease() {

  log.done();
  execSync("npm run examples", {stdio: "inherit"});
  execSync("npm run docs", {stdio: "inherit"});
  let commits = "", releaseUrl = "", zipSize = 0;

  log.timer("compiling release notes");
  execAsync("git log --pretty=format:'* %s (%h)' `git describe --tags --abbrev=0`...HEAD")
    .then(stdout => {
      commits = stdout;
      log.timer("publishing npm package");
      return execAsync("npm publish ./");
    })
    .then(() => {
      log.timer("commiting all modified files for release");
      return execAsync("git add --all");
    })
    .then(() => execAsync(`git commit -m \"compiles v${version}\"`))
    .then(() => {
      log.timer("tagging latest commit");
      return execAsync(`git tag v${version}`);
    })
    .then(() => {
      log.timer("pushing to repository");
      return execAsync("git push origin --follow-tags");
    })
    .then(() => {
      log.timer("publishing release notes");
      github.authenticate({type: "oauth", token});
      return github.repos.createRelease({
        owner: "d3plus",
        repo: name,
        tag_name: `v${version}`,
        name: `v${version}`,
        body: commits,
        prerelease
      });
    })
    .then(() => {
      log.timer("attaching .zip distribution to release");
      return github.repos.getReleaseByTag({
        owner: "d3plus",
        repo: name,
        tag: `v${version}`
      });
    })
    .then(release => {
      releaseUrl = release.data.upload_url;
      zipSize = fs.statSync(`build/${name}.zip`).size;

      return github.repos.uploadAsset({
        url: releaseUrl,
        file: fs.createReadStream(`build/${name}.zip`),
        contentType: "application/zip",
        contentLength: zipSize,
        name: `${name}.zip`,
        label: `${name}.zip`,
        owner: "d3plus",
        repo: name
      });

    })
    .then(() => {
      log.exit();
      shell.exit(0);
    })
    .catch(err => {
      log.fail(err);
      log.exit();
      shell.exit(1);
    });

}
550671
function release(type) {
    target.test();

    echo("Generating new version");
    const newVersion = execSilent("npm version " + type).trim();

    target.changelog();

    // add changelog to commit
    exec("git add CHANGELOG.md");
    exec("git commit --amend --no-edit");

    // replace existing tag
    exec("git tag -f " + newVersion);

    // push all the things
    echo("Publishing to git");
    exec("git push origin master --tags");

    echo("Publishing to npm");
    exec("npm publish");
}
754513
def _add_new_repo(repo, properties):
    '''
    
    '''
    repostr = '# ' if not properties.get('enabled') else ''
    repostr += 'src/gz ' if properties.get('compressed') else 'src '
    if ' ' in repo:
        repostr += '"' + repo + '" '
    else:
        repostr += repo + ' '
    repostr += properties.get('uri')
    repostr = _set_trusted_option_if_needed(repostr, properties.get('trusted'))
    repostr += '\n'
    conffile = os.path.join(OPKG_CONFDIR, repo + '.conf')

    with salt.utils.files.fopen(conffile, 'a') as fhandle:
        fhandle.write(salt.utils.stringutils.to_str(repostr))
505063
def update(ctx, no_restart, no_rebuild):
    """"""

    # 0. (NOT YET! MAKE A BACKUP OF EVERYTHING)
    # 1. update repository
    # 2. update frontend repository
    # 3. (Not yet: update venv)
    # 4. rebuild frontend
    # 5. restart service

    instance = ctx.obj['instance']

    log('Pulling github updates')
    run_process('.', ['git', 'pull', 'origin', 'master'])
    run_process('./frontend', ['git', 'pull', 'origin', 'master'])

    if not no_rebuild:
        log('Rebuilding frontend')
        install_frontend(instance, forcerebuild=True, install=False, development=True)

    if not no_restart:
        log('Restaring service')
        if instance != 'hfos':
            instance = 'hfos-' + instance

        run_process('.', ['sudo', 'systemctl', 'restart', instance])

    log('Done')
8827
def deploy(version):
    
    NAME = "pathquery"
    git = Command("git").in_dir(DIR.project)
    version_file = DIR.project.joinpath("VERSION")
    old_version = version_file.bytes().decode('utf8')
    if version_file.bytes().decode("utf8") != version:
        DIR.project.joinpath("VERSION").write_text(version)
        git("add", "VERSION").run()
        git("commit", "-m", "RELEASE: Version {0} -> {1}".format(
            old_version,
            version
        )).run()
        git("push").run()
        git("tag", "-a", version, "-m", "Version {0}".format(version)).run()
        git("push", "origin", version).run()
    else:
        git("push").run()

    # Set __version__ variable in __init__.py, build sdist and put it back
    initpy = DIR.project.joinpath(NAME, "__init__.py")
    original_initpy_contents = initpy.bytes().decode('utf8')
    initpy.write_text(
        original_initpy_contents.replace("DEVELOPMENT_VERSION", version)
    )
    python("setup.py", "sdist").in_dir(DIR.project).run()
    initpy.write_text(original_initpy_contents)

    # Upload to pypi
    python(
        "-m", "twine", "upload", "dist/{0}-{1}.tar.gz".format(NAME, version)
    ).in_dir(DIR.project).run()
1164481
function () {
				grunt.config('release.localBranch', 'release_' + new Date().getTime());
				var command = [
					'git fetch --tags ' + grunt.config('release.remoteRepository'),
					'git fetch ' + grunt.config('release.remoteRepository'),
					'git checkout -b ' + grunt.config('release.localBranch') + ' ' +
						grunt.config('release.remoteRepository') + '/' + grunt.config('release.remoteBaseBranch')
				].join(' && ');
				grunt.log.write('Checking out new local branch based on ' + grunt.config('release.remoteBaseBranch') + ': ' + command);
				return command;
			}