From 4ff96d98e069b404cf0c1e857d1f7b499a73bf6c Mon Sep 17 00:00:00 2001 From: Roberto Guagliardo Date: Sat, 31 Jan 2026 19:40:26 +0000 Subject: [PATCH] feat: Generate manifest.json from plugin header information --- .github/workflows/release.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4cd1d4a..d52103e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,6 +38,36 @@ jobs: fi echo "version=$VERSION" >> "$GITHUB_OUTPUT" + - name: Genereer manifest.json uit plugin header + run: | + python3 - <<'PY' + import json + import re + + with open('groq-ai-product-text.php', 'r', encoding='utf-8') as handle: + content = handle.read() + + header_match = re.search(r'/\*\*(.*?)\*/', content, re.S) + header = header_match.group(1) if header_match else '' + + def read_field(label: str) -> str: + match = re.search(r'^\s*\*\s*' + re.escape(label) + r'\s*:\s*(.+)$', header, re.M) + return match.group(1).strip() if match else '' + + manifest = { + 'plugin_name': read_field('Plugin Name'), + 'description': read_field('Description'), + 'version': read_field('Version'), + 'author': read_field('Author'), + 'author_url': read_field('Author URI'), + } + + with open('manifest.json', 'w', encoding='utf-8') as handle: + json.dump(manifest, handle, ensure_ascii=False, indent=2) + + print('manifest.json aangemaakt/bijgewerkt') + PY + - name: Check if tag exists id: tagcheck run: |