-
Notifications
You must be signed in to change notification settings - Fork 131
/
monorepo-builder.php
39 lines (34 loc) · 1.22 KB
/
monorepo-builder.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
<?php
declare(strict_types=1);
use Symplify\MonorepoBuilder\ComposerJsonManipulator\ValueObject\ComposerJsonSection;
use Symplify\MonorepoBuilder\Config\MBConfig;
use Symplify\MonorepoBuilder\Release\ReleaseWorker\SetCurrentMutualDependenciesReleaseWorker;
use Symplify\MonorepoBuilder\Release\ReleaseWorker\UpdateReplaceReleaseWorker;
return static function (MBConfig $mbConfig): void {
$mbConfig->packageDirectories([__DIR__ . '/plugins']);
$version = (!empty($_SERVER['argv'][2]))? $_SERVER['argv'][2] : '';
if(!$version) return;
// for "merge" command
$mbConfig->dataToAppend([
ComposerJsonSection::REQUIRE_DEV => [
'phpunit/phpunit' => '^10.1.0',
'symplify/monorepo-builder' => '^11.2',
],
]);
if(preg_match('/^([0-9]+\.[0-9]+\.[0-9]+|patch)$/', $version)) {
/**
* 正式リリース
* タグの送信とマスタの送信
*/
$mbConfig->defaultBranch('master');
$mbConfig->workers([
UpdateReplaceReleaseWorker::class
]);
} elseif(preg_match('/^[0-9]+\.[0-9]+\.[0-9]+-(alpha|beta|rc)/', $version)) {
/**
* alpha / beta / rc
* タグの送信のみ
*/
$mbConfig->defaultBranch('dev-5');
}
};