mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-16 16:34:05 +00:00
include make-release.php in phpstan analysis
This commit is contained in:
parent
e5a2cfb65f
commit
fd2a7797bd
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace pocketmine\build_script;
|
namespace pocketmine\build\make_release;
|
||||||
|
|
||||||
use pocketmine\utils\VersionString;
|
use pocketmine\utils\VersionString;
|
||||||
use function dirname;
|
use function dirname;
|
||||||
@ -37,17 +37,6 @@ use const STDIN;
|
|||||||
|
|
||||||
require_once dirname(__DIR__) . '/vendor/autoload.php';
|
require_once dirname(__DIR__) . '/vendor/autoload.php';
|
||||||
|
|
||||||
if(isset($argv[1])){
|
|
||||||
$currentVer = new VersionString($argv[1]);
|
|
||||||
}else{
|
|
||||||
$currentVer = new VersionString(BASE_VERSION);
|
|
||||||
}
|
|
||||||
$nextVer = new VersionString(sprintf(
|
|
||||||
"%u.%u.%u",
|
|
||||||
$currentVer->getMajor(),
|
|
||||||
$currentVer->getMinor(),
|
|
||||||
$currentVer->getPatch() + 1
|
|
||||||
));
|
|
||||||
|
|
||||||
function replaceVersion(string $versionInfoPath, string $newVersion, bool $isDev) : void{
|
function replaceVersion(string $versionInfoPath, string $newVersion, bool $isDev) : void{
|
||||||
$versionInfo = file_get_contents($versionInfoPath);
|
$versionInfo = file_get_contents($versionInfoPath);
|
||||||
@ -63,17 +52,40 @@ function replaceVersion(string $versionInfoPath, string $newVersion, bool $isDev
|
|||||||
);
|
);
|
||||||
file_put_contents($versionInfoPath, $versionInfo);
|
file_put_contents($versionInfoPath, $versionInfo);
|
||||||
}
|
}
|
||||||
$versionInfoPath = dirname(__DIR__) . '/src/pocketmine/VersionInfo.php';
|
|
||||||
replaceVersion($versionInfoPath, $currentVer->getBaseVersion(), false);
|
|
||||||
|
|
||||||
echo "please add appropriate notes to the changelog and press enter...";
|
/**
|
||||||
fgets(STDIN);
|
* @param string[] $argv
|
||||||
system('git add "' . dirname(__DIR__) . '/changelogs"');
|
* @phpstan-param list<string> $argv
|
||||||
system('git commit -m "Release ' . $currentVer->getBaseVersion() . '" --include "' . $versionInfoPath . '"');
|
*/
|
||||||
system('git tag ' . $currentVer->getBaseVersion());
|
function main(array $argv) : void{
|
||||||
replaceVersion($versionInfoPath, $nextVer->getBaseVersion(), true);
|
if(isset($argv[1])){
|
||||||
system('git add "' . $versionInfoPath . '"');
|
$currentVer = new VersionString($argv[1]);
|
||||||
system('git commit -m "' . $nextVer->getBaseVersion() . ' is next" --include "' . $versionInfoPath . '"');
|
}else{
|
||||||
echo "pushing changes in 5 seconds\n";
|
$currentVer = new VersionString(BASE_VERSION);
|
||||||
sleep(5);
|
}
|
||||||
system('git push origin HEAD ' . $currentVer->getBaseVersion());
|
$nextVer = new VersionString(sprintf(
|
||||||
|
"%u.%u.%u",
|
||||||
|
$currentVer->getMajor(),
|
||||||
|
$currentVer->getMinor(),
|
||||||
|
$currentVer->getPatch() + 1
|
||||||
|
));
|
||||||
|
|
||||||
|
$versionInfoPath = dirname(__DIR__) . '/src/pocketmine/VersionInfo.php';
|
||||||
|
replaceVersion($versionInfoPath, $currentVer->getBaseVersion(), false);
|
||||||
|
|
||||||
|
echo "please add appropriate notes to the changelog and press enter...";
|
||||||
|
fgets(STDIN);
|
||||||
|
system('git add "' . dirname(__DIR__) . '/changelogs"');
|
||||||
|
system('git commit -m "Release ' . $currentVer->getBaseVersion() . '" --include "' . $versionInfoPath . '"');
|
||||||
|
system('git tag ' . $currentVer->getBaseVersion());
|
||||||
|
replaceVersion($versionInfoPath, $nextVer->getBaseVersion(), true);
|
||||||
|
system('git add "' . $versionInfoPath . '"');
|
||||||
|
system('git commit -m "' . $nextVer->getBaseVersion() . ' is next" --include "' . $versionInfoPath . '"');
|
||||||
|
echo "pushing changes in 5 seconds\n";
|
||||||
|
sleep(5);
|
||||||
|
system('git push origin HEAD ' . $currentVer->getBaseVersion());
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!defined('pocketmine\_PHPSTAN_ANALYSIS')){
|
||||||
|
main($argv);
|
||||||
|
}
|
||||||
|
@ -11,9 +11,11 @@ parameters:
|
|||||||
autoload_files:
|
autoload_files:
|
||||||
- tests/phpstan/bootstrap.php
|
- tests/phpstan/bootstrap.php
|
||||||
- src/pocketmine/PocketMine.php
|
- src/pocketmine/PocketMine.php
|
||||||
|
- build/make-release.php
|
||||||
- build/server-phar.php
|
- build/server-phar.php
|
||||||
paths:
|
paths:
|
||||||
- src
|
- src
|
||||||
|
- build/make-release.php
|
||||||
- build/server-phar.php
|
- build/server-phar.php
|
||||||
dynamicConstantNames:
|
dynamicConstantNames:
|
||||||
- pocketmine\IS_DEVELOPMENT_BUILD
|
- pocketmine\IS_DEVELOPMENT_BUILD
|
||||||
|
Loading…
x
Reference in New Issue
Block a user