-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRoboFile.php
44 lines (38 loc) · 1.01 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
<?php
use Robo\Symfony\ConsoleIO;
use Robo\Tasks;
/**
* This is project's console commands configuration for Robo task runner.
*
* @see https://robo.li/
*/
class RoboFile extends Tasks
{
public function release($branch = 'master', $what = 'patch'): void
{
$this->say($what);
$result = $this->taskSemVer()
->increment($what)
->run();
$tag = $result->getMessage();
$this->say("Releasing $tag");
$this->createTag($branch, $tag);
}
/**
* @desc creates a new version tag and pushes to GitHub
* @param string $branch
* @param string $tag
*/
public function createTag(string $branch = '', string $tag = ''): void
{
$this->say("Creating tag $tag on origin::$branch");
$this->taskGitStack()
->stopOnFail()
->add('.semver')
->commit('Update version')
->push('origin', $branch)
->tag($tag)
->push('origin', $tag)
->run();
}
}