fix(cli): remove tpl_ prefix from template element in updates.xml #205
@@ -6,7 +6,7 @@ DEFGROUP: MokoStandards.Root
|
||||
INGROUP: MokoStandards
|
||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
PATH: /README.md
|
||||
VERSION: 09.04.00
|
||||
VERSION: 09.04.03
|
||||
BRIEF: Project overview and documentation
|
||||
-->
|
||||
|
||||
|
||||
@@ -149,10 +149,11 @@ class JoomlaRelease extends CliFramework
|
||||
}
|
||||
|
||||
// ── Step 4: Upload to GitHub Release ──────────────────────────
|
||||
$repoFullName = self::ORG . '/' . ($repo ?: basename($path));
|
||||
$repoFullName = self::ORG . '/' . ($repo ?: basename(realpath($path) ?: $path));
|
||||
|
||||
if (!$dryRun) {
|
||||
$this->ensureRelease($repoFullName, $releaseTag, $displayVersion, $stability);
|
||||
$packageName = "{$prefix}{$meta['element']}-{$displayVersion}";
|
||||
$this->ensureRelease($repoFullName, $releaseTag, $displayVersion, $stability, $meta['name'], $packageName);
|
||||
$this->uploadAsset($repoFullName, $releaseTag, $zipPath, $zipName);
|
||||
$this->uploadAsset($repoFullName, $releaseTag, $tarPath, $tarName);
|
||||
$this->log('SUCCESS', "Uploaded to release: {$releaseTag}");
|
||||
@@ -367,14 +368,17 @@ class JoomlaRelease extends CliFramework
|
||||
|
||||
// ── GitHub Release ───────────────────────────────────────────────
|
||||
|
||||
private function ensureRelease(string $repo, string $tag, string $version, string $stability): void
|
||||
private function ensureRelease(string $repo, string $tag, string $version, string $stability, string $extName = '', string $packageName = ''): void
|
||||
{
|
||||
$releaseName = $extName !== ''
|
||||
? "{$extName} {$version} ({$packageName})"
|
||||
: (($stability === 'stable') ? "v" . explode('.', $version)[0] . " (latest: {$version})" : "{$tag} ({$version})");
|
||||
try {
|
||||
$this->api->get("/repos/{$repo}/releases/tags/{$tag}");
|
||||
} catch (\Exception $e) {
|
||||
$this->api->post("/repos/{$repo}/releases", [
|
||||
'tag_name' => $tag,
|
||||
'name' => ($stability === 'stable') ? "v" . explode('.', $version)[0] . " (latest: {$version})" : "{$tag} ({$version})",
|
||||
'name' => $releaseName,
|
||||
'body' => "## {$version}\n\nCreated by MokoStandards release pipeline.",
|
||||
'prerelease' => ($stability !== 'stable'),
|
||||
]);
|
||||
|
||||
@@ -374,13 +374,12 @@ function buildEntry(
|
||||
$lines[] = " <name>{$displayName}</name>";
|
||||
$lines[] = " <description>{$displayName} {$stabilityLabel} build.</description>";
|
||||
// Element in updates.xml must match what Joomla stores in #__extensions.
|
||||
// Plugins are stored as bare element (folder handles grouping).
|
||||
// All other types need their prefix: mod_, com_, tpl_, pkg_, lib_.
|
||||
// Plugins and templates are stored as bare element (no prefix).
|
||||
// Other types need their prefix: mod_, com_, pkg_, lib_.
|
||||
$prefixMap = [
|
||||
'package' => 'pkg_',
|
||||
'module' => 'mod_',
|
||||
'component' => 'com_',
|
||||
'template' => 'tpl_',
|
||||
'library' => 'lib_',
|
||||
];
|
||||
$dbElement = isset($prefixMap[$extType]) ? $prefixMap[$extType] . $extElement : $extElement;
|
||||
|
||||
Reference in New Issue
Block a user