init
WP Plugin Version & Release / release (push) Failing after 10m54s

This commit is contained in:
Mohamed Youssef
2026-08-02 08:08:26 +03:00
parent 13396847e8
commit d27b4f716f
2 changed files with 272 additions and 83 deletions
+33 -83
View File
@@ -1,95 +1,45 @@
# WP Plugin Auto-Release (Gitea Actions)
# Advanced SEO Meta + AI FAQ Schema
Automatically versions and releases this WordPress plugin whenever the
plugin's `Version:` header changes on `main`. No manual tagging, no
hardcoded plugin name/slug — everything is read straight from the plugin's
own file header.
Advanced SEO Meta + AI FAQ Schema is a WordPress plugin that helps you control how your content appears in search results and AI-powered search experiences.
## What it does
## Features
On every push to `main`, the workflow at
[`.gitea/workflows/wp-plugin-release.yml`](.gitea/workflows/wp-plugin-release.yml) runs:
- Custom SEO title field for posts and pages
- Custom meta description field for better search snippet control
- FAQ builder that lets you add multiple questions and answers
- Automatic JSON-LD FAQPage schema output for AI search engines such as Google SGE and Bing Chat
- Open Graph tags for Facebook and LinkedIn sharing
- Clean meta box in the WordPress editor for easy content optimization
1. **Locate the main plugin file** — scans all `*.php` files for one
containing a `Plugin Name:` header (skips `vendor/`, `node_modules/`,
`build/`).
2. **Extract metadata** — reads `Plugin Name:` and `Version:` from that
file's header comment, then derives a slug from the plugin name
(e.g. `My Cool Plugin``my-cool-plugin`).
3. **Check for a new version** — looks for a git tag `vX.Y.Z` matching the
version found in step 2.
- **Tag already exists** → workflow stops here. Pushing commits without
bumping the version does nothing.
- **Tag doesn't exist** → it's a new release, continue.
4. **Sync `readme.txt`** — updates the `Stable tag:` line to match, if the
file exists, and commits that change back to `main`.
5. **Tag** the commit as `vX.Y.Z` and push the tag.
6. **Build a zip** of the plugin (excluding `.git`, `.gitea`, `.github`,
`node_modules`, `build`), named `<slug>-<version>.zip`.
7. **Publish a Gitea Release** for the new tag with the zip attached as a
downloadable asset.
## What the plugin adds
## Requirements
When editing a post or page, you can fill in:
- A **Gitea Actions runner** (`act_runner`) registered on your instance.
- The runner image needs `rsync`, `zip`, and `git` available (standard on
`ubuntu-latest`-style runner images).
- A **repo secret** named `RELEASE_TOKEN` — a Gitea access token with
repo write / release permissions. Add it under
**Repo → Settings → Secrets**.
- SEO Title
- Meta Description
- FAQ questions and answers
The plugin then outputs:
- A custom page title override
- A meta description tag
- Open Graph meta tags
- Structured FAQ schema in JSON-LD format
## Installation
1. Upload the plugin folder to your WordPress installation's plugins directory.
2. Activate the plugin from the WordPress admin panel.
3. Edit any post or page and look for the "Advanced SEO & AI FAQ Schema" meta box.
## Usage
1. Bump the version in your plugin's main file header:
1. Open a post or page in the editor.
2. Enter a custom SEO title and meta description.
3. Add one or more FAQ entries using the built-in builder.
4. Publish or update the post to make the SEO and schema output available on the front end.
```php
/**
* Plugin Name: My Cool Plugin
* Version: 1.3.0
*/
```
## Notes
2. Commit and push to `main`:
The plugin is designed for posts and pages and works best when used alongside strong on-page content. The FAQ schema is especially useful for improving visibility in AI-driven search experiences.
```bash
git add .
git commit -m "Release 1.3.0"
git push origin main
```
3. The workflow detects the new version, tags `v1.3.0`, builds
`my-cool-plugin-1.3.0.zip`, and publishes it as a Gitea release —
nothing else to do.
## Plugin file requirements
Your main plugin file must use the standard WordPress header format,
with `Plugin Name:` and `Version:` inside the top `/** ... */` comment
block:
```php
<?php
/**
* Plugin Name: My Cool Plugin
* Description: Does cool things.
* Version: 1.3.0
* Author: You
*/
```
If your header format differs significantly (e.g. Version defined only
as a PHP constant with no header line), the parsing step in the workflow
will need a small adjustment.
## Notes & caveats
- **One release per version.** If you push multiple commits without
changing `Version:`, no new tag/release is created — this avoids
duplicate releases on every push.
- **`readme.txt` sync** only runs if the file exists at the repo root;
it's skipped otherwise.
- **Tags are immutable once created** by this workflow — to "redo" a
release, delete the tag and Gitea release first, then push again.
- The zip excludes `.git`, `.gitea`, `.github`, `node_modules`, and
`build` — add more `--exclude` patterns in the "Build plugin zip" step
if you have other dev-only directories (e.g. `tests/`, `.vscode/`).