chore: cascade main → dev (475d2e3) [skip ci]
#200
+37
-15
@@ -224,6 +224,19 @@ if (empty($extType)) {
|
||||
$extType = 'component';
|
||||
}
|
||||
|
||||
// Build display name with type prefix (e.g. "Package - MokoWaaS")
|
||||
$typeDisplayMap = [
|
||||
'package' => 'Package',
|
||||
'plugin' => 'Plugin',
|
||||
'module' => 'Module',
|
||||
'component' => 'Component',
|
||||
'template' => 'Template',
|
||||
'library' => 'Library',
|
||||
'file' => 'File',
|
||||
];
|
||||
$typeDisplay = $typeDisplayMap[$extType] ?? ucfirst($extType);
|
||||
$displayName = "{$typeDisplay} - {$extName}";
|
||||
|
||||
// -- Build type prefix --------------------------------------------------------
|
||||
$typePrefix = '';
|
||||
switch ($extType) {
|
||||
@@ -333,7 +346,8 @@ function buildEntry(
|
||||
string $tagName,
|
||||
string $entryVersion,
|
||||
string $entryDownloadUrl,
|
||||
string $extName,
|
||||
string $displayName,
|
||||
string $stabilityLabel,
|
||||
string $extElement,
|
||||
string $extType,
|
||||
string $clientTag,
|
||||
@@ -345,34 +359,33 @@ function buildEntry(
|
||||
): string {
|
||||
$lines = [];
|
||||
$lines[] = ' <update>';
|
||||
$lines[] = " <name>{$extName}</name>";
|
||||
$lines[] = " <description>{$extName} update</description>";
|
||||
$lines[] = " <name>{$displayName}</name>";
|
||||
$lines[] = " <description>{$displayName} {$stabilityLabel} build.</description>";
|
||||
// Element in updates.xml must match what Joomla stores in #__extensions
|
||||
// For packages: pkg_elementname. For plugins: elementname (folder handles grouping).
|
||||
$dbElement = ($extType === 'package') ? "pkg_{$extElement}" : $extElement;
|
||||
$lines[] = " <element>{$dbElement}</element>";
|
||||
$lines[] = " <type>{$extType}</type>";
|
||||
$lines[] = $clientTag;
|
||||
$lines[] = " <version>{$entryVersion}</version>";
|
||||
if (!empty($clientTag)) {
|
||||
$lines[] = $clientTag;
|
||||
}
|
||||
$lines[] = " <creationDate>" . date('Y-m-d') . "</creationDate>";
|
||||
if (!empty($folderTag)) {
|
||||
$lines[] = $folderTag;
|
||||
}
|
||||
$lines[] = " <tags><tag>{$tagName}</tag></tags>";
|
||||
$lines[] = " <infourl title=\"{$extName}\">{$infoUrl}</infourl>";
|
||||
$lines[] = " <infourl title='{$displayName}'>{$infoUrl}</infourl>";
|
||||
$lines[] = ' <downloads>';
|
||||
$lines[] = " <downloadurl type=\"full\" format=\"zip\">{$entryDownloadUrl}</downloadurl>";
|
||||
$lines[] = " <downloadurl type='full' format='zip'>{$entryDownloadUrl}</downloadurl>";
|
||||
$lines[] = ' </downloads>';
|
||||
if (!empty($shaTag)) {
|
||||
$lines[] = $shaTag;
|
||||
}
|
||||
$lines[] = " <tags><tag>{$tagName}</tag></tags>";
|
||||
$lines[] = ' <maintainer>Moko Consulting</maintainer>';
|
||||
$lines[] = ' <maintainerurl>https://mokoconsulting.tech</maintainerurl>';
|
||||
$lines[] = " {$targetPlatform}";
|
||||
if (!empty($phpTag)) {
|
||||
$lines[] = $phpTag;
|
||||
}
|
||||
$lines[] = ' <maintainer>Moko Consulting</maintainer>';
|
||||
$lines[] = ' <maintainerurl>https://mokoconsulting.tech</maintainerurl>';
|
||||
$lines[] = ' </update>';
|
||||
return implode("\n", $lines);
|
||||
}
|
||||
@@ -397,17 +410,26 @@ $channelVersion = $version . ($stabilitySuffixMap[$stability] ?? '');
|
||||
$channelDownloadUrl = "{$giteaUrl}/{$org}/{$repo}/releases/download/{$giteaTag}/{$typePrefix}{$extElement}-{$channelVersion}.zip";
|
||||
$channelInfoUrl = "{$giteaUrl}/{$org}/{$repo}/releases/tag/{$giteaTag}";
|
||||
|
||||
// Stability labels for descriptions
|
||||
$stabilityLabelMap = [
|
||||
'stable' => 'stable',
|
||||
'rc' => 'rc',
|
||||
'beta' => 'beta',
|
||||
'alpha' => 'alpha',
|
||||
'development' => 'development',
|
||||
];
|
||||
|
||||
for ($i = 0; $i <= $stabilityIndex; $i++) {
|
||||
$channelName = $allChannels[$i];
|
||||
$joomlaTag = $stabilityTagMap[$channelName] ?? $channelName;
|
||||
// Only attach SHA to the primary channel entry
|
||||
$entrySha = ($i === $stabilityIndex) ? $shaTag : '';
|
||||
$stabilityLabel = $stabilityLabelMap[$channelName] ?? $channelName;
|
||||
|
||||
$entries[] = buildEntry(
|
||||
$joomlaTag,
|
||||
$channelVersion,
|
||||
$channelDownloadUrl,
|
||||
$extName,
|
||||
$displayName,
|
||||
$stabilityLabel,
|
||||
$extElement,
|
||||
$extType,
|
||||
$clientTag,
|
||||
@@ -415,7 +437,7 @@ for ($i = 0; $i <= $stabilityIndex; $i++) {
|
||||
$channelInfoUrl,
|
||||
$targetPlatform,
|
||||
$phpTag,
|
||||
$entrySha
|
||||
$shaTag
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user