Generate a RELEASES file
760517
function generateRELEASES(entries) {
    return _.map(entries, function(entry) {
        var filename = entry.filename;

        if (!filename) {
            filename = [
                entry.app,
                entry.version,
                entry.isDelta? 'delta.nupkg' : 'full.nupkg'
            ].join('-');
        }

        return [
            entry.sha,
            filename,
            entry.size
        ].join(' ');
    })
    .join('\n');
}
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')
889665
def release(self, login, package_name, version):
        '''
        
        '''
        url = '%s/release/%s/%s/%s' % (self.domain, login, package_name, version)
        res = self.session.get(url)
        self._check_response(res)
        return res.json()
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"))
1270157
def generateInstaller(self, outpath='.', signed=False):
        
        log.info('Generating Installer....')

        # generate the options for the installer
        opts = {
            'name': self.name(),
            'exname': self.executableName(),
            'version': self.version(),
            'company': self.company(),
            'language': self.language(),
            'license': self.license(),
            'platform': sys.platform,
            'product': self.productName(),
            'outpath': self.outputPath(),
            'instpath': self.installPath(),
            'instname': self.installName(),
            'buildpath': self.buildPath(),
            'srcpath': self.sourcePath(),
            'nsis_exe': os.environ['NSIS_EXE'],
            'signed': '',
            'signcmd': ''
        }

        basetempl = ''
        if self.runtime() and os.path.exists(self.distributionPath()):
            opts['compilepath'] = os.path.join(self.distributionPath(), self.executableName())
            basetempl = templ.NSISAPP

        elif os.path.isfile(self.sourcePath()):
            opts['compilepath'] = self.sourcePath()
            opts['install'] = templ.NSISMODULE.format(**opts)
            basetempl = templ.NSISLIB

        else:
            opts['compilepath'] = self.sourcePath()
            opts['install'] = templ.NSISPACKAGE.format(**opts)
            basetempl = templ.NSISLIB

        # sign the uninstaller
        if signed and self.signcmd():
            cmd = self.signcmd().format(filename='', cert=self.certificate())
            cmd = os.path.expandvars(cmd)
            cmd = cmd.replace('""', '')

            opts['signed'] = '!define SIGNED'
            opts['signcmd'] = cmd

        opts.update(self._installerOptions)

        # expand the plugin paths
        pre_section_plugins = []
        post_section_plugins = []
        install_plugins = []
        uninstall_plugins = []

        for filename in self.installerOption('pre_section_plugins', []):
            with open(filename, 'r') as f:
                pre_section_plugins.append(f.read().format(**opts))

        for filename in self.installerOption('post_section_plugins', []):
            with open(filename, 'r') as f:
                post_section_plugins.append(f.read().format(**opts))

        for filename in self.installerOption('install_section_plugins', []):
            with open(filename, 'r') as f:
                install_plugins.append(f.read().format(**opts))

        for filename in self.installerOption('uninstall_section_plugins', []):
            with open(filename, 'r') as f:
                uninstall_plugins.append(f.read().formst(**opts))

        opts['install_plugins'] = '\n'.join(install_plugins)
        opts['uninstall_plugins'] = '\n'.join(uninstall_plugins)
        opts['pre_section_plugins'] = '\n'.join(pre_section_plugins)
        opts['post_section_plugins'] = '\n'.join(post_section_plugins)
        opts['choose_directory'] = templ.NSISCHOOSEDIRECTORY if opts['choose_dir'] else ''

        req_license = self._installerOptions.pop('require_license_approval', False)
        if req_license:
            opts['require_license_approval'] = templ.NSISLICENSERADIO
        else:
            opts['require_license_approval'] = ''

        outfile = os.path.join(os.path.abspath(outpath), 'autogen.nsi')
        opts['__file__'] = outfile

        # update the additional directories
        addtl = []
        for directory, source in self._installDirectories.items():
            directory = os.path.expandvars(directory.format(**opts))
            directory = os.path.normpath(directory)

            if source:
                source = os.path.expandvars(source.format(**opts))
                source = os.path.abspath(source)

                addtl.append('    SetOutPath "{0}"'.format(directory))
                addtl.append('    File /nonfatal /r "{0}"'.format(source))
            else:
                addtl.append('    CreateDirectory "{0}"'.format(directory))

        opts['addtl_commands'] = '\n'.join(addtl)
        data = basetempl.format(**opts)

        # create the output file
        f = open(outfile, 'w')
        f.write(data)
        f.close()

        installerfile = os.path.join(self.outputPath(), self.installName())
        installerfile += '-{0}.exe'.format(sys.platform)

        # run the installer
        cmd = os.path.expandvars(self.installerOption('cmd'))
        success = cmdexec(cmd.format(script=outfile))

        # sign the installer
        if signed:
            self.sign(installerfile)

        log.info('Executing installer...')
        cmdexec(installerfile)
770043
def release(
    ctx,
    bump,
    bump_type,
    commit_flag,
    message,
    tag_flag,
    confirm_flag,
    changelog_file,
    files,
    label_pattern,
    label_position,
    tag_pattern,
    current_version,
    stage,
    merge_pre,
    current_tag=None,
    versions=None,
):

    
    # If there isn't a current version, assume version 0.0.0
    current_version = current_version or Version()

    git = Git()
    from_tag = current_tag.name if current_tag else None

    # Delimiter of the block to be removed from the changelog file
    remove_pre_chglog = None

    # Look for the last final release version if the user want it
    if merge_pre and current_version.stage != "final":
        remove_pre_chglog = [current_version.string]

        for version in versions:
            if version.stage == "final":
                from_tag = version.tag.name
                remove_pre_chglog.append(version.string)
                break

    commit_list = git.log(_from=from_tag)

    msg(f'{label("Current version")} {current_version}')
    msg(f'{label("Commits found")} {len(commit_list)} since last release')

    if not commit_list:
        click.echo(" › Nothing to release.")
        ctx.exit()

    semantic_commits = commit_analyzer(commit_list, label_pattern, label_position)

    release_data = ReleaseDataTree(semantic_commits)

    bump_version_to = None

    # --bump, --major, --minor, --patch or commit message based version
    # are taken into account only if the current version is in final stage.
    if current_version.stage == "final":

        # --bump have precedence over any of --major, --minor or --patch
        bump_version_to = bump.string if bump else bump_type

        # Any manual bump have precedence over commit message based versions.
        bump_version_to = bump_version_to or release_data.bump_version_to

    try:
        new_version = get_next_version(current_version, bump_version_to, stage)
    except ValueError as e:
        ctx.fail(e)

    if not new_version:
        msg("The release of a lower versions is not supported for now.")
        ctx.abort()

    new_tag_name = tag_pattern.format(version=new_version.string)

    msg(f'{label("New version")} {new_version}')
    msg(f'{label("Changelog file")} {changelog_file.name}')

    # Messages about what tasks will be performed
    msg("Braulio will perform the next tasks :")
    msg(f"        Update {len(files) + 1} files.", prefix="")
    msg("        Add a release commit.", prefix="", silence=not commit_flag)
    msg(
        f"        Tag the repository with {new_tag_name}",
        prefix="",
        silence=not tag_flag,
    )

    msg("", prefix="")  # Print just a new line

    if confirm_flag or click.confirm(f"{prefix_mark}Continue?"):

        msg("Update changelog ", nl=False)

        update_chglog(
            changelog_file,
            new_version=new_version,
            current_version=current_version,
            release_data=release_data,
            remove=remove_pre_chglog,
        )

        msg(check_mark, prefix="")

        try:
            update_files(files, str(current_version), str(new_version))
        except ValueError as e:
            click.echo(e)
            ctx.abort()

        if commit_flag:
            message_args = {"new_version": new_version.string}

            if "{current_version}" in message:
                message_args["current_version"] = current_version.string

            commit_message = message.format(**message_args)

            msg(f"Add commit: {commit_message}", nl=False)

            files = [str(changelog_file)] + list(files)
            git.commit(commit_message, files=files)
            msg(f" {check_mark}", prefix="")

        if tag_flag:
            msg(f"Add tag {new_tag_name}", nl=False)
            git.tag(new_tag_name)
            msg(f" {check_mark}", prefix="")

        if "current_version" in ctx.obj.cfg_file_options:
            update_config_file("current_version", new_version.string)

        msg(f"Version {new_version} released successfully", suffix=" 🎉")
305192
def release():
    ""
    sh("paver bdist_wheel")
    wheels = path("dist").files("*.whl")
    if not wheels:
        error("\n*** ERROR: No release wheel was built!")
        sys.exit(1)
    if any(".dev" in i for i in wheels):
        error("\n*** ERROR: You're still using a 'dev' version!")
        sys.exit(1)

    # Check that source distribution can be built and is complete
    print('')
    print("~" * 78)
    print("TESTING SOURCE BUILD")
    sh( "{ command cd dist/ && unzip -q %s-%s.zip && command cd %s-%s/"
        "  && /usr/bin/python setup.py sdist >/dev/null"
        "  && if { unzip -ql ../%s-%s.zip; unzip -ql dist/%s-%s.zip; }"
        "        | cut -b26- | sort | uniq -c| egrep -v '^ +2 +' ; then"
        "       echo '^^^ Difference in file lists! ^^^'; false;"
        "    else true; fi; } 2>&1"
        % tuple([project["name"], version] * 4)
    )
    path("dist/%s-%s" % (project["name"], version)).rmtree()
    print("~" * 78)

    print('')
    print("Created", " ".join([str(i) for i in path("dist").listdir()]))
    print("Use 'paver sdist bdist_wheel' to build the release and")
    print("    'twine upload dist/*.{zip,whl}' to upload to PyPI")
    print("Use 'paver dist_docs' to prepare an API documentation upload")
22594
function(release) {
    release = release || this.release;
    if (release) {
      if (this.useHash) {
        return addHash(release, this);
      } else {
        return release;
      }
    } else {
      fis.log.error('unreleasable file [%s]', this.realpath);
    }
  }
1077802
function createReleaseTask(level) {
  /**
   * Prepare the release: upgrade version number according to
   * the specified level.
   *
 * @return {WritableStream} The stream pipeline.
   */
  function prepareRelease() {
    return bumpLevel(level);
  }

  return gulp.series(
      prepareRelease,
      performRelease,
      tagRelease,
      prepareNextRelease
  );
}
902473
def create_or_update_release(user, pwd, secret, repo_slug, changelog_file, doc_url, data_file, tag):
    
    # 1- AUTHENTICATION
    if user is not None and secret is None:
        # using username and password
        # validate('user', user, instance_of=str)
        assert isinstance(user, str)
        # validate('pwd', pwd, instance_of=str)
        assert isinstance(pwd, str)
        g = Github(user, pwd)
    elif user is None and secret is not None:
        # or using an access token
        # validate('secret', secret, instance_of=str)
        assert isinstance(secret, str)
        g = Github(secret)
    else:
        raise ValueError("You should either provide username/password OR an access token")
    click.echo("Logged in as {user_name}".format(user_name=g.get_user()))

    # 2- CHANGELOG VALIDATION
    regex_pattern = "[\s\S]*[\n][#]+[\s]*(?P<title>[\S ]*%s[\S ]*)[\n]+?(?P<body>[\s\S]*?)[\n]*?(\n#|$)" % re.escape(tag)
    changelog_section = re.compile(regex_pattern)
    if changelog_file is not None:
        # validate('changelog_file', changelog_file, custom=os.path.exists,
        #          help_msg="changelog file should be a valid file path")
        assert os.path.exists(changelog_file), "changelog file should be a valid file path"
        with open(changelog_file) as f:
            contents = f.read()

        match = changelog_section.match(contents).groupdict()
        if match is None or len(match) != 2:
            raise ValueError("Unable to find changelog section matching regexp pattern in changelog file.")
        else:
            title = match['title']
            message = match['body']
    else:
        title = tag
        message = ''

    # append footer if doc url is provided
    message += "\n\nSee [documentation page](%s) for details." % doc_url

    # 3- REPOSITORY EXPLORATION
    # validate('repo_slug', repo_slug, instance_of=str, min_len=1, help_msg="repo_slug should be a non-empty string")
    assert isinstance(repo_slug, str) and len(repo_slug) > 0, "repo_slug should be a non-empty string"
    repo = g.get_repo(repo_slug)

    # -- Is there a tag with that name ?
    try:
        tag_ref = repo.get_git_ref("tags/" + tag)
    except UnknownObjectException:
        raise ValueError("No tag with name %s exists in repository %s" % (tag, repo.name))

    # -- Is there already a release with that tag name ?
    click.echo("Checking if release %s already exists in repository %s" % (tag, repo.name))
    try:
        release = repo.get_release(tag)
        if release is not None:
            raise ValueError("Release %s already exists in repository %s. Please set overwrite to True if you wish to "
                             "update the release (Not yet supported)" % (tag, repo.name))
    except UnknownObjectException:
        # Release does not exist: we can safely create it.
        click.echo("Creating release %s on repo: %s" % (tag, repo.name))
        click.echo("Release title: '%s'" % title)
        click.echo("Release message:\n--\n%s\n--\n" % message)
        repo.create_git_release(tag=tag, name=title,
                                message=message,
                                draft=False, prerelease=False)

        # add the asset file if needed
        if data_file is not None:
            release = None
            while release is None:
                release = repo.get_release(tag)
            release.upload_asset(path=data_file, label=path.split(data_file)[1], content_type="application/gzip")
900321
function makeReleaseCopies( Release ) {
	shell.mkdir( "-p", cdnFolder );

	Object.keys( releaseFiles ).forEach( function( key ) {
		var text,
			builtFile = releaseFiles[ key ],
			unpathedFile = key.replace( /VER/g, Release.newVersion ),
			releaseFile = cdnFolder + "/" + unpathedFile;

		if ( /\.map$/.test( releaseFile ) ) {

			// Map files need to reference the new uncompressed name;
			// assume that all files reside in the same directory.
			// "file":"jquery.min.js" ... "sources":["jquery.js"]
			text = fs.readFileSync( builtFile, "utf8" )
				.replace( /"file":"([^"]+)"/,
					"\"file\":\"" + unpathedFile.replace( /\.min\.map/, ".min.js\"" ) )
				.replace( /"sources":\["([^"]+)"\]/,
					"\"sources\":[\"" + unpathedFile.replace( /\.min\.map/, ".js" ) + "\"]" );
			fs.writeFileSync( releaseFile, text );
		} else if ( builtFile !== releaseFile ) {
			shell.cp( "-f", builtFile, releaseFile );
		}
	} );
}
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)
1208919
def release():
    """"""
    release_check()
    build()
    print("Releasing %s version %s." % (env.projname, env.version))
    local("git tag %s" % env.version)
    local('gpg --detach-sign --armor dist/coursera-*.tar.gz*')
    local('twine upload dist/coursera-*.tar.gz*')
    local("git push")
    local("git push --tags")
561918
def runs_done():
    """"""
    build = g.build
    release_name, release_number = _get_release_params()

    release = (
        models.Release.query
        .filter_by(build_id=build.id, name=release_name, number=release_number)
        .with_lockmode('update')
        .first())
    utils.jsonify_assert(release, 'Release does not exist')

    release.status = models.Release.PROCESSING
    db.session.add(release)
    _check_release_done_processing(release)
    db.session.commit()

    signals.release_updated_via_api.send(app, build=build, release=release)

    logging.info('Runs done for release: build_id=%r, release_name=%r, '
                 'release_number=%d', build.id, release.name, release.number)

    results_url = url_for(
        'view_release',
        id=build.id,
        name=release.name,
        number=release.number,
        _external=True)

    return flask.jsonify(
        success=True,
        results_url=results_url)
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')
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')
455108
function generate(target, data, done) {
        var files = this.files,
            dest = null,
            paths = [],
            promises = [],
            folders = [];

        //by default, we generate a table of contents called readme.md
        var options = this.options({
            contentsEnabled: true,
            contentsFile: 'readme.md',
            contentsTitle: 'Documentation',
            templateDir: null
        });

        //map the list of files we'll be generating documentation for
        files.forEach(function(group) {
            dest = group.dest;
            group.src.filter(function(file) {
                var obj = {
                    filename: path.basename(file),
                    folder: path.dirname(file),
                    path: file
                };

                if(options.pathFilter)
                    obj.folder = obj.folder.replace(options.pathFilter, '');

                folders.push(obj);
            });
        });

        //map the set of folders, sort, and generate documentation
        folders = _(folders)
            .groupBy(function(p) { return p.folder; })
            .sortBy(function(p) { return p.length && p[0].folder; })
            .map(function(group) {
                var file = group.length && group[0] || {};
                return {
                    name: file.folder,
                    path: file.path.replace(file.filename, ''),
                    files: group,
                    fileData: {}
                };
            })
            .each(function(folder) {
                var def = Q.defer();

                //queue the promise for the docs, and ensure the target exists (can safely run on an existing folder)
                promises.push(def.promise);
                grunt.file.mkdir(dest +'/'+ folder.name);

                //generate the docs for the folder, resolving the promise when complete
                jsdox.generateForDir(folder.path, dest +'/'+ folder.name, options.templateDir, def.resolve, function(file, fileData) {
                    folder.fileData[file] = fileData;
                });
            });

        //when all docs have been generated, build the table of contents, if needed (this stuff should be moved into a template)
        Q.all(promises).then(function() {
            if(!options.contentsEnabled) return done();

            var buf = [],
                w = function() { buf.push.apply(buf, arguments); };

            w(options.contentsTitle || 'Documentation', '===');

            folders.forEach(function(folder) {
                var docs = [];

                //derive the set of documents we *actually* generated docs for; that way we only add documented
                //code to the table of contents
                folder.files.forEach(function(file) {
                    //reset the path, pointing to the markdown file, and set the file data parsed by jsdox
                    file.path = path.join(file.folder, file.filename.replace('.js', '')).replace(/^\//, '');
                    file.data = folder.fileData[file.filename]||{};
                    if(grunt.file.exists(dest, file.path + '.md')) docs.push(file);
                });

                if(docs.length > 0) {
                    w(folder.name || 'Root', '---');
                    w('name | overview', ':-- | :--');
                    docs.forEach(function(file) {
                        w('['+ file.path +'.js]('+ file.path + '.md' + ') | '+ (file.data.overview?'_'+ file.data.overview +'_':''));
                    });
                    w('- - -');
                }

                w('\n');
            });

            //write out the table of contents, and complete the async generate task
            fs.writeFileSync(path.join(dest, (options.contentsFile || 'readme.md')), buf.join('\n'));
            done();
        });
    }