You've already forked wp-fedistream
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 20c879c065 | |||
| d104b0ae46 | |||
| 98ddb63d44 | |||
| 3dd2f4d126 | |||
| dfa405c89b | |||
| a7dbb7b4c5 | |||
| efd3f7a170 | |||
| 077093765e | |||
| d4425103ea | |||
| 02e2ed82ef | |||
| b21394c674 |
193
.gitea/workflows/release.yml
Normal file
193
.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,193 @@
|
||||
name: Create Release Package
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build-release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
extensions: mbstring, xml, zip, intl, gettext
|
||||
tools: composer:v2
|
||||
|
||||
- name: Get version from tag
|
||||
id: version
|
||||
run: |
|
||||
VERSION=${GITHUB_REF_NAME#v}
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "Building version: $VERSION"
|
||||
|
||||
- name: Validate composer.json
|
||||
run: composer validate --strict
|
||||
|
||||
- name: Install Composer dependencies (production)
|
||||
run: |
|
||||
composer config platform.php 8.3.0
|
||||
composer install --no-dev --optimize-autoloader --no-interaction
|
||||
|
||||
- name: Install gettext
|
||||
run: apt-get update && apt-get install -y gettext
|
||||
|
||||
- name: Compile translations
|
||||
run: |
|
||||
for po in languages/*.po; do
|
||||
if [ -f "$po" ]; then
|
||||
mo="${po%.po}.mo"
|
||||
echo "Compiling $po to $mo"
|
||||
msgfmt -o "$mo" "$po"
|
||||
fi
|
||||
done
|
||||
|
||||
- name: Verify plugin version matches tag
|
||||
run: |
|
||||
PLUGIN_VERSION=$(grep -oP "Version:\s*\K[0-9]+\.[0-9]+\.[0-9]+" wp-fedistream.php | head -1)
|
||||
TAG_VERSION=${{ steps.version.outputs.version }}
|
||||
if [ "$PLUGIN_VERSION" != "$TAG_VERSION" ]; then
|
||||
echo "Error: Plugin version ($PLUGIN_VERSION) does not match tag version ($TAG_VERSION)"
|
||||
exit 1
|
||||
fi
|
||||
echo "Version verified: $PLUGIN_VERSION"
|
||||
|
||||
- name: Create release directory
|
||||
run: mkdir -p releases
|
||||
|
||||
- name: Build release package
|
||||
run: |
|
||||
VERSION=${{ steps.version.outputs.version }}
|
||||
PLUGIN_NAME="wp-fedistream"
|
||||
RELEASE_FILE="releases/${PLUGIN_NAME}-${VERSION}.zip"
|
||||
|
||||
# Move to parent directory for proper zip structure
|
||||
cd ..
|
||||
|
||||
# Create zip with proper WordPress plugin structure
|
||||
zip -r "${PLUGIN_NAME}/${RELEASE_FILE}" "${PLUGIN_NAME}" \
|
||||
-x "${PLUGIN_NAME}/.git/*" \
|
||||
-x "${PLUGIN_NAME}/.gitea/*" \
|
||||
-x "${PLUGIN_NAME}/.github/*" \
|
||||
-x "${PLUGIN_NAME}/.vscode/*" \
|
||||
-x "${PLUGIN_NAME}/.claude/*" \
|
||||
-x "${PLUGIN_NAME}/CLAUDE.md" \
|
||||
-x "${PLUGIN_NAME}/wp-core" \
|
||||
-x "${PLUGIN_NAME}/wp-core/*" \
|
||||
-x "${PLUGIN_NAME}/wp-plugins" \
|
||||
-x "${PLUGIN_NAME}/wp-plugins/*" \
|
||||
-x "${PLUGIN_NAME}/releases/*" \
|
||||
-x "${PLUGIN_NAME}/composer.lock" \
|
||||
-x "${PLUGIN_NAME}/*.log" \
|
||||
-x "${PLUGIN_NAME}/.gitignore" \
|
||||
-x "${PLUGIN_NAME}/.editorconfig" \
|
||||
-x "${PLUGIN_NAME}/phpcs.xml*" \
|
||||
-x "${PLUGIN_NAME}/phpunit.xml*" \
|
||||
-x "${PLUGIN_NAME}/tests/*" \
|
||||
-x "${PLUGIN_NAME}/*.po~" \
|
||||
-x "${PLUGIN_NAME}/*.bak" \
|
||||
-x "*.DS_Store"
|
||||
|
||||
cd "${PLUGIN_NAME}"
|
||||
echo "Created: ${RELEASE_FILE}"
|
||||
|
||||
- name: Generate checksums
|
||||
run: |
|
||||
VERSION=${{ steps.version.outputs.version }}
|
||||
RELEASE_FILE="releases/wp-fedistream-${VERSION}.zip"
|
||||
|
||||
cd releases
|
||||
sha256sum "wp-fedistream-${VERSION}.zip" > "wp-fedistream-${VERSION}.zip.sha256"
|
||||
|
||||
echo "SHA256:"
|
||||
cat "wp-fedistream-${VERSION}.zip.sha256"
|
||||
|
||||
- name: Verify package structure
|
||||
run: |
|
||||
set +o pipefail
|
||||
VERSION=${{ steps.version.outputs.version }}
|
||||
echo "Package contents:"
|
||||
unzip -l "releases/wp-fedistream-${VERSION}.zip" | head -50 || true
|
||||
|
||||
# Verify main file is at correct location
|
||||
if unzip -l "releases/wp-fedistream-${VERSION}.zip" | grep -q "wp-fedistream/wp-fedistream.php"; then
|
||||
echo "✓ Main plugin file at correct location"
|
||||
else
|
||||
echo "✗ Error: Main plugin file not found at wp-fedistream/wp-fedistream.php"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Verify vendor directory is included
|
||||
if unzip -l "releases/wp-fedistream-${VERSION}.zip" | grep -q "wp-fedistream/vendor/"; then
|
||||
echo "✓ Vendor directory included"
|
||||
else
|
||||
echo "✗ Error: Vendor directory not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Extract changelog for release notes
|
||||
id: changelog
|
||||
run: |
|
||||
VERSION=${{ steps.version.outputs.version }}
|
||||
# Extract changelog section for this version
|
||||
NOTES=$(sed -n "/^## \[${VERSION}\]/,/^## \[/p" CHANGELOG.md | sed '$ d' | tail -n +2)
|
||||
if [ -z "$NOTES" ]; then
|
||||
NOTES="Release version ${VERSION}"
|
||||
fi
|
||||
# Save to file for multi-line output
|
||||
echo "$NOTES" > release_notes.txt
|
||||
echo "Release notes extracted"
|
||||
|
||||
- name: Create Gitea Release
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.SRC_GITEA_TOKEN }}
|
||||
run: |
|
||||
VERSION=${{ steps.version.outputs.version }}
|
||||
TAG_NAME=${{ github.ref_name }}
|
||||
PRERELEASE="false"
|
||||
if [[ "$TAG_NAME" == *-* ]]; then
|
||||
PRERELEASE="true"
|
||||
fi
|
||||
|
||||
# Read release notes
|
||||
BODY=$(cat release_notes.txt)
|
||||
|
||||
# Create release via Gitea API
|
||||
RELEASE_RESPONSE=$(curl -s -X POST \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\": \"${TAG_NAME}\", \"name\": \"Release ${VERSION}\", \"body\": $(echo "$BODY" | jq -Rs .), \"draft\": false, \"prerelease\": ${PRERELEASE}}" \
|
||||
"${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}/releases")
|
||||
|
||||
RELEASE_ID=$(echo "$RELEASE_RESPONSE" | jq -r '.id')
|
||||
|
||||
if [ "$RELEASE_ID" == "null" ] || [ -z "$RELEASE_ID" ]; then
|
||||
echo "Failed to create release:"
|
||||
echo "$RELEASE_RESPONSE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Created release ID: $RELEASE_ID"
|
||||
|
||||
# Upload attachments
|
||||
for file in "releases/wp-fedistream-${VERSION}.zip" "releases/wp-fedistream-${VERSION}.zip.sha256"; do
|
||||
if [ -f "$file" ]; then
|
||||
FILENAME=$(basename "$file")
|
||||
echo "Uploading $FILENAME..."
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
--data-binary "@$file" \
|
||||
"${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=${FILENAME}"
|
||||
echo "Uploaded $FILENAME"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Release created successfully: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases/tag/${TAG_NAME}"
|
||||
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule "lib/wc-licensed-product-client"]
|
||||
path = lib/wc-licensed-product-client
|
||||
url = ../wc-licensed-product-client.git
|
||||
20
CHANGELOG.md
20
CHANGELOG.md
@@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.4.0] - 2026-01-29
|
||||
|
||||
### Added
|
||||
|
||||
- Gitea Actions CI/CD pipeline for automated release package creation
|
||||
- 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
|
||||
- Pre-release detection for tags containing `-`
|
||||
|
||||
## [0.3.0] - 2026-01-29
|
||||
|
||||
### Added
|
||||
@@ -175,7 +191,9 @@ Initial release of WP FediStream - a WordPress plugin for streaming music over A
|
||||
|
||||
---
|
||||
|
||||
[Unreleased]: https://src.bundespruefstelle.ch/magdev/wp-fedistream/compare/v0.2.0...HEAD
|
||||
[Unreleased]: https://src.bundespruefstelle.ch/magdev/wp-fedistream/compare/v0.4.0...HEAD
|
||||
[0.4.0]: https://src.bundespruefstelle.ch/magdev/wp-fedistream/compare/v0.3.0...v0.4.0
|
||||
[0.3.0]: https://src.bundespruefstelle.ch/magdev/wp-fedistream/compare/v0.2.0...v0.3.0
|
||||
[0.2.0]: https://src.bundespruefstelle.ch/magdev/wp-fedistream/compare/v0.1.1...v0.2.0
|
||||
[0.1.1]: https://src.bundespruefstelle.ch/magdev/wp-fedistream/compare/v0.1.0...v0.1.1
|
||||
[0.1.0]: https://src.bundespruefstelle.ch/magdev/wp-fedistream/releases/tag/v0.1.0
|
||||
|
||||
78
CLAUDE.md
78
CLAUDE.md
@@ -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,39 @@ 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 v0.4.0
|
||||
|
||||
**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 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
|
||||
- `CHANGELOG.md` - Added v0.4.0 entry
|
||||
- `wp-fedistream.php` - Version bump to 0.4.0
|
||||
|
||||
**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
|
||||
- User simplified checksums to SHA256 only (removed MD5)
|
||||
|
||||
@@ -16,13 +16,13 @@
|
||||
},
|
||||
"repositories": [
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://src.bundespruefstelle.ch/magdev/wc-licensed-product-client.git"
|
||||
"type": "path",
|
||||
"url": "lib/wc-licensed-product-client"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=8.3",
|
||||
"magdev/wc-licensed-product-client": "^0.1",
|
||||
"magdev/wc-licensed-product-client": "^0.2",
|
||||
"twig/twig": "^3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
|
||||
16
composer.lock
generated
16
composer.lock
generated
@@ -4,15 +4,15 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "29e8e4e069b25dee0a610019a77dab50",
|
||||
"content-hash": "0c8153ac31232ffe7f0af117cec865b4",
|
||||
"packages": [
|
||||
{
|
||||
"name": "magdev/wc-licensed-product-client",
|
||||
"version": "v0.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://src.bundespruefstelle.ch/magdev/wc-licensed-product-client.git",
|
||||
"reference": "83037ea0c2d9e365cf9ec0ad50251d3ebc7e4782"
|
||||
"version": "v0.2.2",
|
||||
"dist": {
|
||||
"type": "path",
|
||||
"url": "lib/wc-licensed-product-client",
|
||||
"reference": "f9281ec5fb23bf1993ab0240e0347c835009a10f"
|
||||
},
|
||||
"require": {
|
||||
"php": "^8.3",
|
||||
@@ -51,7 +51,9 @@
|
||||
"issues": "https://src.bundespruefstelle.ch/magdev/wc-licensed-product-client/issues",
|
||||
"source": "https://src.bundespruefstelle.ch/magdev/wc-licensed-product-client"
|
||||
},
|
||||
"time": "2026-01-22T15:24:57+00:00"
|
||||
"transport-options": {
|
||||
"relative": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "psr/cache",
|
||||
|
||||
1
lib/wc-licensed-product-client
Submodule
1
lib/wc-licensed-product-client
Submodule
Submodule lib/wc-licensed-product-client added at 56abe8a97c
@@ -3,7 +3,7 @@
|
||||
* Plugin Name: WP FediStream
|
||||
* Plugin URI: https://src.bundespruefstelle.ch/magdev/wp-fedistream
|
||||
* Description: Stream music over ActivityPub - Build your own music streaming platform for Musicians and Labels.
|
||||
* Version: 0.3.0
|
||||
* Version: 0.4.0
|
||||
* Requires at least: 6.4
|
||||
* Requires PHP: 8.3
|
||||
* Author: Marco Graetsch
|
||||
@@ -26,7 +26,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
define( 'WP_FEDISTREAM_VERSION', '0.3.0' );
|
||||
define( 'WP_FEDISTREAM_VERSION', '0.4.0' );
|
||||
|
||||
/**
|
||||
* Plugin file path.
|
||||
|
||||
Reference in New Issue
Block a user