Merge pull request 'feat: skip version bump on non-code changes + dev alias fix' (#213) from dev into main
Generic: Repo Health / Site Health (push) Has been skipped
Universal: Cascade Main → Dev / Cascade main → branches (push) Failing after 3s
Generic: Repo Health / Access control (push) Successful in 2s
Platform: moko-platform CI / Gate 1: Code Quality (push) Failing after 57s
Platform: moko-platform CI / Gate 2: Unit Tests (8.1) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.2) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.3) (push) Has been cancelled
Platform: moko-platform CI / Gate 3: Self-Health Check (push) Has been cancelled
Platform: moko-platform CI / Gate 4: Governance (push) Has been cancelled
Platform: moko-platform CI / Gate 5: Template Integrity (push) Has been cancelled
Platform: moko-platform CI / CI Summary (push) Has been cancelled
Generic: Repo Health / Release configuration (push) Has been cancelled
Generic: Repo Health / Scripts governance (push) Has been cancelled
Generic: Repo Health / Repository health (push) Has been cancelled
Generic: Repo Health / Site Health (push) Has been skipped
Universal: Cascade Main → Dev / Cascade main → branches (push) Failing after 3s
Generic: Repo Health / Access control (push) Successful in 2s
Platform: moko-platform CI / Gate 1: Code Quality (push) Failing after 57s
Platform: moko-platform CI / Gate 2: Unit Tests (8.1) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.2) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.3) (push) Has been cancelled
Platform: moko-platform CI / Gate 3: Self-Health Check (push) Has been cancelled
Platform: moko-platform CI / Gate 4: Governance (push) Has been cancelled
Platform: moko-platform CI / Gate 5: Template Integrity (push) Has been cancelled
Platform: moko-platform CI / CI Summary (push) Has been cancelled
Generic: Repo Health / Release configuration (push) Has been cancelled
Generic: Repo Health / Scripts governance (push) Has been cancelled
Generic: Repo Health / Repository health (push) Has been cancelled
This commit was merged in pull request #213.
This commit is contained in:
@@ -299,6 +299,7 @@ $stabilitySuffixMap = [
|
||||
'beta' => '-beta',
|
||||
'alpha' => '-alpha',
|
||||
'development' => '-dev',
|
||||
'dev' => '-dev',
|
||||
];
|
||||
|
||||
// Joomla <tags><tag> values — maps to Joomla's stabilityTagToInteger()
|
||||
@@ -308,6 +309,7 @@ $stabilityTagMap = [
|
||||
'beta' => 'beta',
|
||||
'alpha' => 'alpha',
|
||||
'development' => 'dev',
|
||||
'dev' => 'dev',
|
||||
];
|
||||
|
||||
// Gitea release tag names (used in download/info URLs)
|
||||
@@ -317,6 +319,7 @@ $releaseTagMap = [
|
||||
'beta' => 'beta',
|
||||
'alpha' => 'alpha',
|
||||
'development' => 'development',
|
||||
'dev' => 'development',
|
||||
];
|
||||
|
||||
// -- Build update entries -----------------------------------------------------
|
||||
|
||||
+42
-14
@@ -26,11 +26,14 @@ $token = '';
|
||||
$repoUrl = '';
|
||||
$dryRun = false;
|
||||
|
||||
$watchPath = '';
|
||||
|
||||
foreach ($argv as $i => $arg) {
|
||||
if ($arg === '--path' && isset($argv[$i + 1])) $path = $argv[$i + 1];
|
||||
if ($arg === '--branch' && isset($argv[$i + 1])) $branch = $argv[$i + 1];
|
||||
if ($arg === '--token' && isset($argv[$i + 1])) $token = $argv[$i + 1];
|
||||
if ($arg === '--repo-url' && isset($argv[$i + 1])) $repoUrl = $argv[$i + 1];
|
||||
if ($arg === '--path' && isset($argv[$i + 1])) $path = $argv[$i + 1];
|
||||
if ($arg === '--branch' && isset($argv[$i + 1])) $branch = $argv[$i + 1];
|
||||
if ($arg === '--token' && isset($argv[$i + 1])) $token = $argv[$i + 1];
|
||||
if ($arg === '--repo-url' && isset($argv[$i + 1])) $repoUrl = $argv[$i + 1];
|
||||
if ($arg === '--watch-path' && isset($argv[$i + 1])) $watchPath = $argv[$i + 1];
|
||||
if ($arg === '--dry-run') $dryRun = true;
|
||||
}
|
||||
|
||||
@@ -62,17 +65,42 @@ if (array_key_exists($branch, $stabilityMap)) {
|
||||
$cli = __DIR__;
|
||||
$php = PHP_BINARY;
|
||||
|
||||
// Step 1: Patch bump — all branches get patch bumps
|
||||
$shouldBump = true;
|
||||
|
||||
if ($shouldBump) {
|
||||
$bumpOutput = [];
|
||||
exec("{$php} {$cli}/version_bump.php --path " . escapeshellarg($path) . " 2>&1", $bumpOutput, $bumpRc);
|
||||
foreach ($bumpOutput as $line) {
|
||||
echo "{$line}\n";
|
||||
// Auto-detect watch path from manifest.xml if not provided
|
||||
if (empty($watchPath)) {
|
||||
$manifestFile = realpath($path) . '/.mokogitea/manifest.xml';
|
||||
if (file_exists($manifestFile)) {
|
||||
$xml = @simplexml_load_file($manifestFile);
|
||||
if ($xml && isset($xml->build->{'entry-point'})) {
|
||||
$watchPath = (string) $xml->build->{'entry-point'};
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "Skipping patch bump on {$branch} branch (suffix change only)\n";
|
||||
}
|
||||
|
||||
// Check if code files actually changed (skip bump for docs/config-only changes)
|
||||
$shouldBump = true;
|
||||
if (!empty($watchPath)) {
|
||||
$root = realpath($path) ?: $path;
|
||||
$diffOutput = trim((string) @shell_exec(
|
||||
"cd " . escapeshellarg($root) . " && git diff --name-only HEAD~1 HEAD -- " . escapeshellarg($watchPath) . " 2>/dev/null"
|
||||
));
|
||||
if (empty($diffOutput)) {
|
||||
echo "No changes in {$watchPath} — skipping version bump\n";
|
||||
$shouldBump = false;
|
||||
} else {
|
||||
echo "Changes detected in {$watchPath}:\n{$diffOutput}\n";
|
||||
}
|
||||
}
|
||||
|
||||
if (!$shouldBump) {
|
||||
echo "No code changes — nothing to do\n";
|
||||
exit(0);
|
||||
}
|
||||
|
||||
// Step 1: Patch bump
|
||||
$bumpOutput = [];
|
||||
exec("{$php} {$cli}/version_bump.php --path " . escapeshellarg($path) . " 2>&1", $bumpOutput, $bumpRc);
|
||||
foreach ($bumpOutput as $line) {
|
||||
echo "{$line}\n";
|
||||
}
|
||||
|
||||
// Step 2: Read version
|
||||
|
||||
Reference in New Issue
Block a user