2019-11-30 15:33:39 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Robo\Tasks;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Manage robo tasks.
|
|
|
|
*/
|
|
|
|
class RoboFile extends Tasks
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create release archive
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function release()
|
|
|
|
{
|
2020-06-22 21:15:31 +00:00
|
|
|
$this->stopOnFail();
|
|
|
|
|
2019-11-30 15:33:39 +00:00
|
|
|
$result = $this->taskExec('git')
|
2020-06-22 21:15:31 +00:00
|
|
|
->arg('describe')
|
2019-11-30 15:33:39 +00:00
|
|
|
->run();
|
|
|
|
$result->provideOutputdata();
|
|
|
|
|
2020-06-22 21:15:31 +00:00
|
|
|
$tmpDir = $this->_tmpDir();
|
|
|
|
|
|
|
|
$filename = 'alltube-' . trim($result->getOutputData()) . '.zip';
|
2019-11-30 15:33:39 +00:00
|
|
|
|
2020-06-22 21:15:31 +00:00
|
|
|
$this->taskFilesystemStack()
|
|
|
|
->remove($filename)
|
|
|
|
->run();
|
2019-11-30 15:33:39 +00:00
|
|
|
|
2020-06-22 21:15:31 +00:00
|
|
|
$this->taskGitStack()
|
|
|
|
->cloneRepo(__DIR__, $tmpDir)
|
|
|
|
->run();
|
2019-11-30 15:33:39 +00:00
|
|
|
|
2020-06-22 21:15:31 +00:00
|
|
|
$this->taskComposerInstall()
|
|
|
|
->dir($tmpDir)
|
|
|
|
->optimizeAutoloader()
|
|
|
|
->noDev()
|
|
|
|
->run();
|
|
|
|
|
|
|
|
$this->taskPack($filename)
|
|
|
|
->addDir('alltube', $tmpDir)
|
|
|
|
->run();
|
2019-11-30 15:33:39 +00:00
|
|
|
}
|
|
|
|
}
|