fix(version): preserve suffix on bump, simplify workflow version logic (#191)
Generic: Repo Health / Site Health (push) Has been cancelled
Generic: Repo Health / Access control (push) Has been cancelled
Universal: PR Check / Branch Policy (pull_request) Has been cancelled
Generic: Repo Health / Site Health (pull_request) Has been cancelled
Generic: Repo Health / Access control (pull_request) Has been cancelled
Universal: Secret Scanning / Gitleaks Secret Scan (pull_request) Has been cancelled
Universal: Auto Version Bump / Version Bump (push) Has been cancelled
Universal: PR Check / Validate PR (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 1: Code Quality (push) Has been cancelled
Platform: moko-platform CI / Gate 1: Code Quality (pull_request) Has been cancelled
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
Platform: moko-platform CI / Gate 2: Unit Tests (8.1) (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.2) (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.3) (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 3: Self-Health Check (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 4: Governance (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 5: Template Integrity (pull_request) Has been cancelled
Platform: moko-platform CI / CI Summary (pull_request) 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
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Generic: Repo Health / Release configuration (pull_request) Has been cancelled
Generic: Repo Health / Scripts governance (pull_request) Has been cancelled
Generic: Repo Health / Repository health (pull_request) Has been cancelled

version_bump.php now captures the existing suffix (e.g. -dev) from
manifest.xml and re-applies it after incrementing the base version.
This lets workflows read the version as-is instead of stripping and
re-applying suffixes based on branch names.

Simplified update-server.yml and pre-release.yml by removing the
strip→map→re-apply suffix dance. Removed DISPLAY_VERSION and SUFFIX
output variables — VERSION now carries the full suffixed string.

Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jonathan Miller
2026-05-31 14:01:34 -05:00
parent 66e728b078
commit 1ecd9239ed
5 changed files with 51 additions and 51 deletions
+17 -1
View File
@@ -68,7 +68,7 @@ class VersionBumpTest extends TestCase
$this->execute();
$content = file_get_contents("{$this->tmpDir}/README.md");
$this->assertStringContainsString('03.05.02', $content);
$this->assertStringContainsString('09.21.08', $content);
$this->assertStringContainsString('Some content', $content);
}
@@ -86,6 +86,22 @@ class VersionBumpTest extends TestCase
$this->assertStringContainsString('01.00.01', $output);
}
public function testPreservesSuffixOnBump(): void
{
mkdir("{$this->tmpDir}/.mokogitea", 0755, true);
file_put_contents(
"{$this->tmpDir}/.mokogitea/manifest.xml",
'<manifest><identity><version>01.02.03-dev</version></identity></manifest>'
);
$this->writeReadme('01.02.03');
$output = $this->execute();
$this->assertStringContainsString('01.02.04-dev', $output);
$manifest = file_get_contents("{$this->tmpDir}/.mokogitea/manifest.xml");
$this->assertStringContainsString('01.02.04-dev', $manifest);
}
public function testFailsWithNoVersion(): void
{
file_put_contents(