-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathRoboFile.php
47 lines (40 loc) · 1.22 KB
/
RoboFile.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* This is project's console commands configuration for Robo task runner.
*
* @see http://robo.li/
*/
use Symfony\Component\Finder\Finder;
class RoboFile extends \Robo\Tasks {
function pharPackage() {
$packer = $this->taskPackPhar('ocok.phar');
$files = Finder::create()->ignoreVCS(true)
->files()
->name('*.php')
->path('vendor/autoload.php')
->path('src')
->path('vendor/ifsnop')
->path('vendor/symfony')
->path('vendor/composer')
->in(__DIR__);
foreach ($files as $file) {
$packer->addFile($file->getRelativePathname(), $file->getRealPath());
}
$packer
->addFile('ocok','ocok')
->executable('ocok')
->run();
}
function pharPublish() {
$this->pharPackage();
rename('ocok.phar', 'ocok-release.phar');
$this->taskGitStack()->checkout('gh-pages')->run();
rename('ocok-release.phar', 'ocok.phar');
$this->taskGitStack()
->add('ocok.phar')
->commit('ocok.phar published')
->push('origin','gh-pages')
->checkout('master')
->run();
}
}