diff --git a/RoboFile.php b/RoboFile.php deleted file mode 100644 index 53f97fd..0000000 --- a/RoboFile.php +++ /dev/null @@ -1,46 +0,0 @@ -stopOnFail(); - - $result = $this->taskExec('git') - ->arg('describe') - ->run(); - $result->provideOutputdata(); - - $tmpDir = $this->_tmpDir(); - - $filename = 'alltube-' . trim($result->getOutputData()) . '.zip'; - - $this->taskFilesystemStack() - ->remove($filename) - ->run(); - - $this->taskGitStack() - ->cloneRepo(__DIR__, $tmpDir) - ->run(); - - $this->taskComposerInstall() - ->dir($tmpDir) - ->optimizeAutoloader() - ->noDev() - ->run(); - - $this->taskPack($filename) - ->addDir('alltube', $tmpDir) - ->run(); - } -} diff --git a/classes/Robo/Plugin/Commands/ReleaseCommand.php b/classes/Robo/Plugin/Commands/ReleaseCommand.php new file mode 100644 index 0000000..869b44a --- /dev/null +++ b/classes/Robo/Plugin/Commands/ReleaseCommand.php @@ -0,0 +1,59 @@ +stopOnFail(); + + /** @var Exec $gitTask */ + $gitTask = $this->taskExec('git'); + $result = $gitTask + ->arg('describe') + ->run(); + $result->provideOutputdata(); + + $tmpDir = $this->_tmpDir(); + + $filename = 'alltube-' . trim((string)$result->getOutputData()) . '.zip'; + + /** @var FilesystemStack $rmTask */ + $rmTask = $this->taskFilesystemStack(); + $rmTask->remove($filename) + ->run(); + + /** @var GitStack $gitTask */ + $gitTask = $this->taskGitStack(); + $gitTask->cloneRepo(__DIR__ . '/../../../../', $tmpDir) + ->run(); + + /** @var Install $composerTask */ + $composerTask = $this->taskComposerInstall(); + $composerTask->dir($tmpDir) + ->optimizeAutoloader() + ->noDev() + ->run(); + + /** @var Pack $packTask */ + $packTask = $this->taskPack($filename); + $packTask->addDir('alltube', $tmpDir) + ->run(); + } +} diff --git a/grumphp.yml b/grumphp.yml index 8454537..df983e1 100644 --- a/grumphp.yml +++ b/grumphp.yml @@ -8,9 +8,5 @@ parameters: composer: ~ phpcs: standard: PSR12 - ignore_patterns: - - RoboFile.php phpstan: level: max - ignore_patterns: - - RoboFile.php