public function publishRelease($repository, $label = 'none', $origin = '') {
      if (!in_array($label, ['rc', 'beta', 'alpha', 'none'])) {
         throw new \InvalidArgumentException('Release label, can be rc, beta, alpha or none');
      }
      $this->options['label'] = $label;

      // changelog generation
      $result = $this->makeChangelog($repository);
      if (null !== $result && $result->wasCancelled()) {
         $this->say($result->getMessage());
         return;
      }

      $newVersion = $this->newVersion;
      $releaseBranch = 'release/' . $newVersion;

      // git-flow start
      $this->taskGitStack()->checkout('-b ' . $releaseBranch)->run();

      // Continue the git flow
      $filename = 'CHANGELOG.md';
      $commitMessage = 'docs: updated project files for new release.';
      $composerFile = 'composer.json';
      $this->composerUpdate($composerFile);
      $this->taskGitStack()->add($filename)->add($composerFile)
         ->commit($commitMessage, '--no-gpg-sign')
         ->checkout('-b robo-master upstream/master')
         ->merge($releaseBranch)->tag($newVersion)
         ->checkout('-b robo-develop upstream/develop')->merge($releaseBranch)
         ->run();

      // finish git-flow with delete release branch
      $this->taskGitStack()->exec('branch -D ' . $releaseBranch)->run();

      // make changelog for gh-pages
      $this->taskGitStack()->checkout('-b robo-gh-pages upstream/gh-pages')->checkout('robo-develop ' . $filename)->run();
      $this->_exec('mv -f ' . $filename. ' _includes/' . $filename);
      $this->taskGitStack()->add('_includes/' .$filename)->commit($commitMessage, '--no-gpg-sign')->run();

      // publish the changes
      if ($origin) {
         $this->taskGitStack()
            ->push($origin, 'robo-gh-pages:gh-pages')
            ->push($origin, 'robo-develop:develop')
            ->push($origin, 'robo-master:master')
            ->push($origin, $newVersion)
            ->run();
      }
   }
public function publishRelease($repository, $label = 'none', $origin = '') {
      if (!in_array($label, ['rc', 'beta', 'alpha', 'none'])) {
         throw new \InvalidArgumentException('Release label, can be rc, beta, alpha or none');
      }
      $this->options['label'] = $label;

      // changelog generation
      $result = $this->makeChangelog($repository);
      if (null !== $result && $result->wasCancelled()) {
         $this->say($result->getMessage());
         return;
      }

      $newVersion = $this->newVersion;
      $releaseBranch = 'release/' . $newVersion;

      // git-flow start
      $this->taskGitStack()->checkout('-b ' . $releaseBranch)->run();

      // Continue the git flow
      $filename = 'CHANGELOG.md';
      $commitMessage = 'docs: updated project files for new release.';
      $composerFile = 'composer.json';
      $this->composerUpdate($composerFile);
      $this->taskGitStack()->add($filename)->add($composerFile)
         ->commit($commitMessage, '--no-gpg-sign')
         ->checkout('-b robo-master upstream/master')
         ->merge($releaseBranch)->tag($newVersion)
         ->checkout('-b robo-develop upstream/develop')->merge($releaseBranch)
         ->run();

      // finish git-flow with delete release branch
      $this->taskGitStack()->exec('branch -D ' . $releaseBranch)->run();

      // make changelog for gh-pages
      $this->taskGitStack()->checkout('-b robo-gh-pages upstream/gh-pages')->checkout('robo-develop ' . $filename)->run();
      $this->_exec('mv -f ' . $filename. ' _includes/' . $filename);
      $this->taskGitStack()->add('_includes/' .$filename)->commit($commitMessage, '--no-gpg-sign')->run();

      // publish the changes
      if ($origin) {
         $this->taskGitStack()
            ->push($origin, 'robo-gh-pages:gh-pages')
            ->push($origin, 'robo-develop:develop')
            ->push($origin, 'robo-master:master')
            ->push($origin, $newVersion)
            ->run();
      }
   }
public function publishRelease ( $ repository , $ label = 'none' , $ origin = '' ) { if ( ! in_array ( $ label , [ 'rc' , 'beta' , 'alpha' , 'none' ] ) ) { throw new \ InvalidArgumentException ( 'Release label, can be rc, beta, alpha or none' ) ; } $ this -> options [ 'label' ] = $ label ; // changelog generation $ result = $ this -> makeChangelog ( $ repository ) ; if ( null !== $ result && $ result -> wasCancelled ( ) ) { $ this -> say ( $ result -> getMessage ( ) ) ; return ; } $ newVersion = $ this -> newVersion ; $ releaseBranch = 'release/' . $ newVersion ; // git-flow start $ this -> taskGitStack ( ) -> checkout ( '-b ' . $ releaseBranch ) -> run ( ) ; // Continue the git flow $ filename = 'CHANGELOG.md' ; $ commitMessage = 'docs: updated project files for new release.' ; $ composerFile = 'composer.json' ; $ this -> composerUpdate ( $ composerFile ) ; $ this -> taskGitStack ( ) -> add ( $ filename ) -> add ( $ composerFile ) -> commit ( $ commitMessage , '--no-gpg-sign' ) -> checkout ( '-b robo-master upstream/master' ) -> merge ( $ releaseBranch ) -> tag ( $ newVersion ) -> checkout ( '-b robo-develop upstream/develop' ) -> merge ( $ releaseBranch ) -> run ( ) ; // finish git-flow with delete release branch $ this -> taskGitStack ( ) -> exec ( 'branch -D ' . $ releaseBranch ) -> run ( ) ; // make changelog for gh-pages $ this -> taskGitStack ( ) -> checkout ( '-b robo-gh-pages upstream/gh-pages' ) -> checkout ( 'robo-develop ' . $ filename ) -> run ( ) ; $ this -> _exec ( 'mv -f ' . $ filename . ' _includes/' . $ filename ) ; $ this -> taskGitStack ( ) -> add ( '_includes/' . $ filename ) -> commit ( $ commitMessage , '--no-gpg-sign' ) -> run ( ) ; // publish the changes if ( $ origin ) { $ this -> taskGitStack ( ) -> push ( $ origin , 'robo-gh-pages:gh-pages' ) -> push ( $ origin , 'robo-develop:develop' ) -> push ( $ origin , 'robo-master:master' ) -> push ( $ origin , $ newVersion ) -> run ( ) ; } }
Task to publish a release similar to git-flow
@param $repository
@param string $label
@param string $origin
@throws Exception
Task to publish a release similar to git - flow