File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ :major: 0
3+ :minor: 0
4+ :patch: 0
5+ :special: ''
6+ :metadata: ''
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use Robo \Symfony \ConsoleIO ;
4+ use Robo \Tasks ;
5+
6+ /**
7+ * This is project's console commands configuration for Robo task runner.
8+ *
9+ * @see https://robo.li/
10+ */
11+ class RoboFile extends Tasks
12+ {
13+ public function release (ConsoleIO $ io , $ opt = [
14+ 'branch ' => 'main ' ,
15+ 'what ' => 'patch '
16+ ]): void
17+ {
18+ $ result = $ this ->taskSemVer ()
19+ ->increment ($ opt ['what ' ])
20+ ->run ();
21+
22+ $ tag = $ result ->getMessage ();
23+
24+ $ this ->say ("Releasing $ tag " );
25+
26+ $ this ->clean ($ io );
27+ $ this ->publishGit ($ opt ['branch ' ], ['tag ' => $ tag ]);
28+ }
29+
30+ public function clean (ConsoleIO $ io ): void
31+ {
32+ $ io ->say ('Cleaning up ' );
33+ $ this ->taskCleanDir (['logs ' ])->run ();
34+ $ this ->taskDeleteDir ('logs ' )->run ();
35+ }
36+
37+ /**
38+ * @desc creates a new version tag and pushes to GitHub
39+ * @param null $branch
40+ * @param array $opt
41+ */
42+ public function publishGit ($ branch = null , $ opt = ['tag ' => null ])
43+ {
44+ $ this ->say ('Pushing ' . $ opt ['tag ' ] . ' to GitHub ' );
45+ $ this ->taskExec ('git tag ' . $ opt ['tag ' ])
46+ ->run ();
47+ $ this ->taskExec ("git push origin $ branch --tags " )
48+ ->run ();
49+ }
50+ }
Original file line number Diff line number Diff line change 2323 "psr-4" : {
2424 "BeastBytes\\ PostalCode\\ " : " src"
2525 }
26+ },
27+ "require-dev" : {
28+ "consolidation/robo" : " ^4.0"
29+ },
30+ "scripts" : {
31+ "robo" : " robo"
2632 }
2733}
You can’t perform that action at this time.
0 commit comments