Skip to content

Commit bcd5f49

Browse files
author
Maxim Harder
committed
feat: update and localization files
Обновите README с инструкциями для manifest.json, удалите crowdin.yml, если файлы локализации отсутствуют, и удалите скрипт обновления из GitHub workflows, если он не нужен. Также измените шаблон отчета об ошибках, добавив дополнительные варианты версий DLE, и добавьте лицензию GNU General Public License версии 3 в проект.
1 parent bf9dbea commit bcd5f49

File tree

10 files changed

+814
-4
lines changed

10 files changed

+814
-4
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
github: [Gokujo,]
44
ko_fi: devcraft
5-
custom: ['https://paypal.me/MaximH', 'https://sobe.ru/na/devcraftclub', 'https://yoomoney.ru/to/41001454367103', 'https://www.donationalerts.com/r/maharder', 'https://devcraft.club/donate/drives/na-chaj.1/']
5+
custom: ['https://paypal.me/MaximH', 'https://sobe.ru/na/devcraftclub', 'https://yoomoney.ru/to/41001454367103', 'https://www.donationalerts.com/r/maharder']

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ body:
5050
label: Версия DLE
5151
description: На какой версии DLE это произошло?
5252
options:
53-
- "16.x (Default)"
53+
- "17.3 (Default)"
54+
- "17.2"
55+
- "17.1"
56+
- "17.0"
57+
- "17.х"
58+
- "16.x"
5459
- "15.x"
5560
- "14.x"
5661
- "13.x"

.github/ISSUE_TEMPLATE/custom.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ body:
3434
label: Версия DLE
3535
description: На какую версию DLE расчитывать?
3636
options:
37-
- "16.x (Default)"
37+
- "17.3 (Default)"
38+
- "17.2"
39+
- "17.1"
40+
- "17.0"
41+
- "17.х"
42+
- "16.x"
3843
- "15.x"
3944
- "14.x"
4045
- "13.x"

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ body:
3434
label: Версия DLE
3535
description: На какую версию DLE расчитывать?
3636
options:
37-
- "16.x (Default)"
37+
- "17.3 (Default)"
38+
- "17.2"
39+
- "17.1"
40+
- "17.0"
41+
- "17.х"
42+
- "16.x"
3843
- "15.x"
3944
- "14.x"
4045
- "13.x"

.github/scripts/update_readme.php

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?php
2+
// Пути к файлам
3+
$ROOT = dirname(__FILE__, 3);
4+
5+
$manifestPath = ROOT . '/manifest.json';
6+
$readmePath = ROOT . '/README.md';
7+
8+
// Проверяем наличие manifest.json
9+
if (!file_exists($manifestPath)) {
10+
die("Файл manifest.json не найден.\n");
11+
}
12+
13+
// Читаем и парсим manifest.json
14+
$manifestContent = file_get_contents($manifestPath);
15+
$manifest = json_decode($manifestContent, true);
16+
17+
// Проверяем корректность JSON
18+
if (json_last_error() !== JSON_ERROR_NONE) {
19+
die("Ошибка парсинга JSON: " . json_last_error_msg() . "\n");
20+
}
21+
22+
// Формируем badges
23+
$badges = [];
24+
25+
// Badge: Текущая версия
26+
if (isset($manifest['version'])) {
27+
$badges[] = "![Текущая версия](https://img.shields.io/badge/version-{$manifest['version']}-green?style=for-the-badge)";
28+
}
29+
30+
// Badge: Статус
31+
if (isset($manifest['status'])) {
32+
$badges[] = "![Статус](https://img.shields.io/badge/status-{$manifest['status']}-orange?style=for-the-badge)";
33+
}
34+
35+
// Badge: DLE Version
36+
if (!empty($manifest['dle']) && is_array($manifest['dle'])) {
37+
$dleVersions = implode(', ', $manifest['dle']);
38+
$badges[] = "![DLE Version](https://img.shields.io/badge/DLE-$dleVersions-blue?style=for-the-badge)";
39+
}
40+
41+
// Badge: PHP Version
42+
if (!empty($manifest['php']) && is_array($manifest['php'])) {
43+
$phpVersions = implode(', ', $manifest['php']);
44+
$badges[] = "![PHP Version](https://img.shields.io/badge/PHP-$phpVersions-red?style=for-the-badge)";
45+
}
46+
47+
// Генерируем Markdown для badges
48+
$newBadgesMarkdown = implode("", $badges);
49+
50+
// Читаем README.md
51+
if (!file_exists($readmePath)) {
52+
die("Файл README.md не найден.\n");
53+
}
54+
$readmeContent = file_get_contents($readmePath);
55+
56+
// Обновляем badges в README.md
57+
$updatedReadmeContent = preg_replace(
58+
'/(?<=# MHAdmin\n\n)(.*?)(?=\n\n\[)/s',
59+
$newBadgesMarkdown . "\n",
60+
$readmeContent
61+
);
62+
63+
// Сохраняем обновленный README.md
64+
if (file_put_contents($readmePath, $updatedReadmeContent) !== false) {
65+
echo "README.md успешно обновлен.\n";
66+
} else {
67+
echo "Ошибка обновления README.md.\n";
68+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Update README
2+
3+
on:
4+
push:
5+
paths:
6+
- "manifest.json"
7+
8+
jobs:
9+
update-readme:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
# Шаг 1: Клонируем репозиторий
14+
- name: Checkout repository
15+
uses: actions/checkout@v3
16+
17+
# Шаг 2: Устанавливаем PHP
18+
- name: Set up PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: '8.3'
22+
23+
# Шаг 3: Запускаем скрипт
24+
- name: Run PHP script
25+
run: php ./.github/workflows/update_readme.php
26+
27+
# Шаг 4: Коммит изменений
28+
- name: Commit changes
29+
run: |
30+
git config --local user.name "GitHub Actions"
31+
git config --local user.email "actions@github.com"
32+
git add README.md .last_manifest_version
33+
git commit -m "Update README.md based on manifest.json"
34+
git push

0 commit comments

Comments
 (0)