Merge pull request 'fix: version_read/bump handle suffixed versions and HTML-comment VERSION' (#83) from dev into main
Generic: Repo Health / Site Health (push) Has been skipped
Generic: Repo Health / Access control (push) Successful in 1s
Universal: Cascade Main → Dev / Cascade main → branches (push) Successful in 2s
Generic: Repo Health / Release configuration (push) Successful in 4s
Generic: Repo Health / Scripts governance (push) Successful in 4s
Generic: Repo Health / Repository health (push) Successful in 9s

This commit was merged in pull request #83.
This commit is contained in:
2026-05-25 05:16:21 +00:00
3 changed files with 8 additions and 5 deletions
+3
View File
@@ -22,6 +22,9 @@ Version format: `XX.YY.ZZ` (zero-padded semver).
- `cli/bulk_workflow_push.php` — push a workflow file to all governed repos via Gitea Contents API (closes #52)
### Fixed
- `version_read.php` / `version_bump.php`: handle suffixed versions in XML manifests (e.g. `01.00.00-dev`)
- `version_read.php` / `version_bump.php`: match `VERSION:` inside HTML comments (`<!-- VERSION: ... -->`)
- Pre-release RC builds now work after a development pre-release has been built
- auto-release workflow: switch trigger from `pull_request closed` to `push` on main (closes #54)
- CI Gate 1: add ondrej/php PPA + composer package for PHP 8.2 on runners
- CI repo-health: use `.mokogitea/workflows/` instead of `.gitea/workflows/`
+3 -3
View File
@@ -30,7 +30,7 @@ $readme = "{$root}/README.md";
$readmeContent = '';
if (file_exists($readme)) {
$readmeContent = file_get_contents($readme);
if (preg_match('/^\s*VERSION:\s*(\d{2}\.\d{2}\.\d{2})/m', $readmeContent, $m)) {
if (preg_match('/VERSION:\s*(\d{2}\.\d{2}\.\d{2})/m', $readmeContent, $m)) {
$readmeVersion = $m[1];
}
}
@@ -52,7 +52,7 @@ foreach ($manifestFiles as $xmlFile) {
if (strpos($xmlContent, '<extension') === false && strpos($xmlContent, '<version>') === false) {
continue;
}
if (preg_match('|<version>(\d{2}\.\d{2}\.\d{2})</version>|', $xmlContent, $xm)) {
if (preg_match('|<version>(\d{2}\.\d{2}\.\d{2})(?:-[a-z]+)?</version>|', $xmlContent, $xm)) {
$candidate = $xm[1];
if ($manifestVersion === null || version_compare($candidate, $manifestVersion, '>')) {
$manifestVersion = $candidate;
@@ -102,7 +102,7 @@ $new = sprintf('%02d.%02d.%02d', $major, $minor, $patch);
// ── Update README.md ─────────────────────────────────────────────────────────
if (file_exists($readme) && !empty($readmeContent)) {
$updated = preg_replace(
'/^(\s*VERSION:\s*)\d{2}\.\d{2}\.\d{2}/m',
'/(VERSION:\s*)\d{2}\.\d{2}\.\d{2}/m',
'${1}' . $new,
$readmeContent,
1
+2 -2
View File
@@ -28,7 +28,7 @@ $readmeVersion = null;
$readme = "{$root}/README.md";
if (file_exists($readme)) {
$content = file_get_contents($readme);
if (preg_match('/^\s*VERSION:\s*(\d{2}\.\d{2}\.\d{2})/m', $content, $m)) {
if (preg_match('/VERSION:\s*(\d{2}\.\d{2}\.\d{2})/m', $content, $m)) {
$readmeVersion = $m[1];
}
}
@@ -47,7 +47,7 @@ foreach ($manifestFiles as $xmlFile) {
if (strpos($xmlContent, '<extension') === false && strpos($xmlContent, '<version>') === false) {
continue;
}
if (preg_match('|<version>(\d{2}\.\d{2}\.\d{2})</version>|', $xmlContent, $xm)) {
if (preg_match('|<version>(\d{2}\.\d{2}\.\d{2})(?:-[a-z]+)?</version>|', $xmlContent, $xm)) {
$candidate = $xm[1];
if ($manifestVersion === null || version_compare($candidate, $manifestVersion, '>')) {
$manifestVersion = $candidate;