feat: Add Gitea Actions CI/CD pipeline for releases (v0.4.0)
Some checks failed
Create Release Package / build-release (push) Failing after 4s

- Automated release builds triggered by v* tags
- PHP 8.3 environment with production dependencies
- Automatic translation compilation (.po to .mo)
- Version verification (plugin version must match tag)
- WordPress-compliant zip structure
- SHA256 checksum generation
- Package structure verification
- Changelog extraction for release notes
- Automatic Gitea release creation with attachments

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-29 15:40:08 +01:00
parent f3cd19efe0
commit b21394c674
4 changed files with 248 additions and 4 deletions

View File

@@ -126,11 +126,48 @@ for po in languages/*.po; do msgfmt -o "${po%.po}.mo" "$po"; done
#### What's Excluded
- Git metadata (`.git/`)
- Development files (`.vscode/`, `.claude/`, `CLAUDE.md`, `wp-core`, `wp-plugins`)
- Development files (`.vscode/`, `.claude/`, `.gitea/`, `CLAUDE.md`, `wp-core`, `wp-plugins`)
- Logs and cache files
- Previous releases
- `composer.lock` (but `vendor/` is included)
#### CI/CD Pipeline (Gitea Actions)
Automated release packages are created via Gitea Actions when a tag matching `v*` is pushed:
**Workflow:** `.gitea/workflows/release.yml`
**Trigger:** Push tag `vX.X.X` to repository
**Steps:**
1. Checkout code
2. Setup PHP 8.3 with required extensions
3. Install production Composer dependencies
4. Compile translations (.po to .mo)
5. Verify plugin version matches tag version
6. Build release zip with proper WordPress structure
7. Generate SHA256 checksums
8. Verify package structure
9. Extract changelog for release notes
10. Create Gitea release with attachments
**Required Secret:** `GITEA_TOKEN` - Personal access token with release permissions
**Pre-release Detection:** Tags containing `-` (e.g., `v1.0.0-beta`) are marked as pre-release
**To create a release:**
```bash
# Ensure version is updated in wp-fedistream.php (both header and constant)
git checkout main
git merge dev
git tag -a v0.4.0 -m "Release v0.4.0"
git push origin main --tags
```
The pipeline will automatically build and publish the release package.
---
**For AI Assistants:**
@@ -184,6 +221,9 @@ When editing CLAUDE.md or other markdown files, follow these rules to avoid lint
```txt
wp-fedistream/
├── .gitea/
│ └── workflows/
│ └── release.yml # CI/CD release pipeline
├── assets/
│ ├── css/
│ │ ├── admin.css # Admin interface styles
@@ -464,3 +504,36 @@ wp-fedistream/
- Package name is `magdev/wc-licensed-product-client` (not `wc-license-product-client`)
- Uses Symfony HTTP Client via the license client package
- License validation cached for 24 hours using WordPress transients
### 2026-01-29 - CI/CD Pipeline
**Summary:** Added Gitea Actions workflow for automated release package creation.
**Features:**
- Automated release builds triggered by `v*` tags
- PHP 8.3 environment with required extensions
- Production Composer dependency installation
- Automatic translation compilation (.po to .mo)
- Version verification (plugin version must match tag)
- Proper WordPress plugin zip structure
- SHA256 and MD5 checksum generation
- Package structure verification
- Changelog extraction for release notes
- Automatic Gitea release creation with attachments
- Pre-release detection for tags containing `-`
**Files Created:**
- `.gitea/workflows/release.yml` - CI/CD release pipeline
**Files Modified:**
- `CLAUDE.md` - Added CI/CD documentation and updated directory structure
**Notes:**
- Requires `GITEA_TOKEN` secret configured in repository settings
- Uses `shivammathur/setup-php@v2` for PHP setup
- Uses `actions/gitea-release-action@v1` for release creation
- Compatible with GitHub Actions syntax