Public Access
refactor: simplify version extraction — derive filename from manifest version (#191)
Version string (e.g. 01.02.14-dev) is now read once from the manifest and flows through unchanged. Removes DISPLAY_VERSION/SUFFIX re-derivation from branch names in workflows. Authored-by: Moko Consulting Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -30,7 +30,7 @@ if (file_exists($mokoManifest)) {
|
||||
$xml = @simplexml_load_file($mokoManifest);
|
||||
if ($xml !== false) {
|
||||
$v = (string)($xml->identity->version ?? '');
|
||||
if (preg_match('/^\d{2}\.\d{2}\.\d{2}$/', $v)) {
|
||||
if (preg_match('/^\d{2}\.\d{2}\.\d{2}(-[a-z]+)?$/', $v)) {
|
||||
$mokoVersion = $v;
|
||||
}
|
||||
}
|
||||
@@ -127,7 +127,7 @@ if ($versionSource === 'manifest' && !empty($manifestVersionSuffix)) {
|
||||
// -- Backfill: if manifest.xml exists but lacks <version>, insert it --
|
||||
if (file_exists($mokoManifest)) {
|
||||
$content = file_get_contents($mokoManifest);
|
||||
if (!preg_match('|<version>\d{2}\.\d{2}\.\d{2}</version>|', $content)) {
|
||||
if (!preg_match('|<version>\d{2}\.\d{2}\.\d{2}(-[a-z]+)?</version>|', $content)) {
|
||||
if (strpos($content, '<license') !== false) {
|
||||
$content = preg_replace(
|
||||
'|(\s*<license)|',
|
||||
|
||||
Reference in New Issue
Block a user