Release the build package on GitHub

@return  bool

@since   1.0
776228
public function run()
	{
		$version    = $this->getJConfig()->version;
		$remote     = $this->getJConfig()->github->remote;
		$branch     = $this->getJConfig()->github->branch;
		$owner      = $this->getJConfig()->github->owner;
		$repository = $this->getJConfig()->github->repository;

		$this->say('Creating package ' . $this->getJConfig()->extension . " " . $this->getJConfig()->version);

		$latest_release = $this->getLatestReleases();
		$pulls          = $this->getAllRepoPulls();

		$changes = $this->getChanges($latest_release, $pulls);

		$this->changelogUpdate($changes);

		$this->taskGitStack()
			->add('CHANGELOG.md')
			->commit("Prepare for release version " . $version)
			->push($remote, $branch)
			->run();

		$this->say("Creating github tag: $version");

		$this->taskGitStack()
			->stopOnFail()
			->tag($version)
			->push($remote, $version)
			->run();

		$this->say("Tag created: $version and published at $owner/$repository");

		$this->say("Creating the release at: https://github.com/$owner/$repository/releases/tag/$version");

		$github           = $this->getGithub();
		$changesInRelease = "# Changelog: \n\n" . implode("\n* ", $changes);

		$response = $github->repositories->releases->create(
			$owner,
			$repository,
			(string) $version,
			'',
			$this->getJConfig()->extension . " " . $version,
			$changesInRelease,
			false,
			true
		);

		$this->say(print_r($repository, true));

		$this->uploadToGithub($version, $this->getJConfig()->github->token, $response->upload_url);
	}
1363085
public function load() {
		if ( ! apply_filters( 'github_updater_hide_settings', false ) ) {
			Singleton::get_instance( 'Settings', $this )->run();
		}
		if ( ! Singleton::get_instance( 'Init', $this )->can_update() ) {
			return false;
		}

		// Run GitHub Updater upgrade functions.
		$upgrade = new GHU_Upgrade();
		$upgrade->run();

		// Load plugin stylesheet.
		add_action(
			'admin_enqueue_scripts',
			function () {
				wp_register_style( 'github-updater', plugins_url( basename( GITHUB_UPDATER_DIR ) ) . '/css/github-updater.css' );
				wp_enqueue_style( 'github-updater' );
			}
		);

		if ( isset( $_POST['ghu_refresh_cache'] ) ) {
			/**
			 * Fires later in cycle when Refreshing Cache.
			 *
			 * @since 6.0.0
			 */
			do_action( 'ghu_refresh_transients' );
		}

		$this->get_meta_plugins();
		$this->get_meta_themes();

		return true;
	}
1266757
public function release($args)
    {
        $json = $this->container->json;
        $markdown = $this->container->markdownParser;
        $responseBody = '';

        // If curl is not installed display alert
        if (!function_exists('curl_init')) {
            $this->setAlert('warning', 'Required PHP cURL not installed');
        } else {
            // https://developer.github.com/v3/repos/releases
            $githubApi = 'https://api.github.com/repos/PitonCMS/Engine/releases';
            $curl = curl_init();
            curl_setopt_array($curl, [
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_URL => $githubApi,
                CURLOPT_USERAGENT => $this->request->getHeaderLine('HTTP_USER_AGENT')
            ]);
            $responseBody = curl_exec($curl);
            $responseStatus = curl_getinfo($curl, CURLINFO_HTTP_CODE);
            curl_close($curl);

            // Verify that we have a response
            if ($responseStatus == '200') {
                $releases = json_decode($responseBody);
                $releases = array_slice($releases, 0, 5, true);

                // Format Markdown
                foreach ($releases as $key => $release) {
                    $releases[$key]->body = $markdown->text($release->body);
                }

                // Check if there is a more current release
                if (array_search($args['release'], array_column($releases, 'tag_name')) > 0) {
                    $message = "The current version is {$releases[0]->tag_name}, you have version {$args['release']}.";
                    $message .= "\nTo upgrade, from your project root run <code>composer update pitoncms/engine</code>";
                    $this->setAlert('info', 'There is a newer version of the PitonCMS Engine', $message);
                }
            } else {
                $releases = [];
                $this->setAlert('warning', "$responseStatus Response From GitHub", $responseBody);
            }
        }

        return $this->render('releaseNotes.html', ['releases' => $releases]);
    }
260728
public function actionPush()
	{
		$collection = \App::$domain->vendor->info->all();
		Output::pipe('Git push packages');
		foreach($collection as $entity) {
			Output::line($entity->package);
			try {
				Output::line();
				\App::$domain->vendor->git->push($entity);
				Output::line();
			} catch(ShellException $e) {
				Yii::$app->end();
			}
		}
		Output::pipe();
		Output::line();
	}
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");
}
953963
public function isAppReadyToInstall() {
		$checkPHPversion = $this->checkPhpVersion();
		if ($checkPHPversion === false) {
			return false;
		}

		$checkPHPextensions = $this->checkPhpExtensions(true);
		if ($checkPHPextensions === false) {
			return false;
		}

		return true;
	}
989328
public static function release()
	{
		if ( is_null( self::$authFileP ) ) return;
		$a = @flock( self::$authFileP , LOCK_UN );
		@fclose( self::$authFileP );
		self::$authFileP       = null;
		self::$currentlylocked = false;
	}
957490
function createRelease(version) {
      if(version) {
        releaseOptions.target_commitish = version;
      }
      github.repos.createRelease(releaseOptions, function() {
        nextRepo();
      });
    }
272098
protected function buildCopy() {
    $exclude_list_file = $this->getExcludeListFile();
    $source = $this->getConfigValue('repo.root');
    $dest = $this->deployDir;

    $this->setMultisiteFilePermissions(0777);
    $this->say("Rsyncing files from source repo into the build artifact...");
    $this->taskExecStack()->exec("rsync -a --no-g --delete --delete-excluded --exclude-from='$exclude_list_file' '$source/' '$dest/' --filter 'protect /.git/'")
      ->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERBOSE)
      ->stopOnFail()
      ->dir($this->getConfigValue('repo.root'))
      ->run();
    $this->setMultisiteFilePermissions(0755);

    // Remove temporary file that may have been created by
    // $this->getExcludeListFile().
    $this->taskFilesystemStack()
      ->remove($this->excludeFileTemp)
      ->copy(
        $this->getConfigValue('deploy.gitignore_file'),
        $this->deployDir . '/.gitignore', TRUE
      )
      ->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERBOSE)
      ->run();

  }
927815
public function SetupPackages() {

		$halted = false;

		foreach($this->Packages as $pkg) {
			try { $pkg->Setup($this); }
			catch(Exception $e) {
				$this->ShowMessage($e->getMessage());
				$halted = true;
			}
		}

		if($halted) $this->ShowMessage('Operation aborted.');
		else $this->ShowMessage('Operation complete.');

		return $this;
	}
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')
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);
    });

}
108853
public function uninstall(): OperationResult
    {
        $result = new OperationResult();

        foreach (self::ENV_FILES as $file) {
            $file = "{$this->projectRootDir}/{$file}";
            if (file_exists($file)) {
                $envContent = file_get_contents($file);
                assert(is_string($envContent));

                $startString = "\n###BEGIN-Rikudou-Installer-{$this->packageName}###";
                $endString = "###END-Rikudou-Installer-{$this->packageName}###";

                $startPos = strpos($envContent, $startString);
                if ($startPos === false) {
                    continue;
                }
                $endPos = strpos($envContent, $endString, $startPos);
                if ($endPos === false) {
                    continue;
                }
                $endPos += strlen($endString);

                $resultEnv = substr_replace($envContent, '', $startPos, $endPos - $startPos);
                if (file_put_contents($file, $resultEnv, LOCK_EX) === false) {
                    $result->addErrorMessage("Could not uninstall env variables from {$this->packageName}");
                }
            }
        }

        if ($result->isSuccess()) {
            $result->addStatusMessage("Successfully uninstalled env variables from {$this->packageName}");
        }

        return $result;
    }
39256
function performRelease() {
  return gulp.src([config.pkg, config.dist])
      .pipe(git.add({args: '-f'}))
      .pipe(git.commit('release: release version'));
}
97452
public function deploy()
    {
        $isFtp = $this->connections->getCurrentConnectionKey()->isFtp();

        $from = $this->on('dummy', function () {
            $this->setupIfNecessary();
            $this->executeTask('CreateRelease');
            $this->executeTask('PrepareRelease');

            return $this->releasesManager->getCurrentReleasePath();
        });

        $to = $isFtp
            ? $this->paths->getFolder()
            : $this->releasesManager->getCurrentReleasePath();

        return $this->onReleaseReady($from, $to);
    }
711265
private function releaseAssets()
    {
        $assetDir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets';
        $dirs = \Yii::$app->assetManager->publish($assetDir, [
            'forceCopy' => YII_DEBUG
        ]);
        return BaseUrl::base(true) . $dirs[1] .'/';
    }
1317851
def release():
    

    with settings(warn_only=True):
        r = local(clom.git['diff-files']('--quiet', '--ignore-submodules', '--'))

    if r.return_code != 0:
        abort('There are uncommitted changes, commit or stash them before releasing')

    version = open('VERSION.txt').read().strip()

    print('Releasing %s...' % version)
    local(clom.git.flow.release.start(version))
    local(clom.git.flow.release.finish(version, m='Release-%s' % version))
    local(clom.git.push('origin', 'master', 'develop', tags=True))
    local(clom.python('setup.py', 'sdist', 'upload'))