Skip to content
Merged

Dev #13

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
01c98d8
feat: expand SchemaTypeRegistry to 250+ comprehensive schema.org types
dannorthern Aug 12, 2025
99f1801
docs: add filter usage examples for extending/removing schema types
dannorthern Aug 12, 2025
36d4b63
docs: add example for replacing entire schema type registry
dannorthern Aug 12, 2025
b1e29cf
tests: add additional tests
dannorthern Aug 12, 2025
ac787ed
test: fix SchemaTypeRegistry tests to handle expanded type list
dannorthern Aug 12, 2025
e7280bd
fix: remove broken tests that were never properly implemented
dannorthern Aug 12, 2025
859102c
feat: add category metadata and organization filtering to SchemaTypeR…
dannorthern Aug 12, 2025
a8bad46
feat: add get_content_types() method for content-focused schema types
dannorthern Aug 12, 2025
3f4f73d
docs: document schema type categorization features
dannorthern Aug 12, 2025
480d28d
feat: add special identity types to organization types
dannorthern Aug 12, 2025
3862219
refactor: migrate to centralized GitHub Actions workflows
dannorthern Aug 17, 2025
7fabbfb
feat: add wp_schema_framework_output_enabled filter for external control
dannorthern Aug 18, 2025
a86afe4
ci: add scheduled workflow
dannorthern Aug 19, 2025
f3a6670
feat: add ProductProvider with smart e-commerce detection
dannorthern Aug 26, 2025
e4f3f3b
feat: add EventProvider with smart event plugin detection
dannorthern Aug 26, 2025
6c48798
feat: add conflict detection and enhanced hooks for wp-schema
dannorthern Aug 26, 2025
3aef126
Merge pull request #12 from builtnorth/enhancements-one
dannorthern Aug 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
204 changes: 7 additions & 197 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,204 +16,14 @@ on:
type: boolean
default: false

env:
# Package-specific configuration - customize these for each package
PACKAGE_NAME: ${{ vars.PACKAGE_NAME || 'wp-schema' }}
PACKAGE_DISPLAY_NAME: ${{ vars.PACKAGE_DISPLAY_NAME || 'WP Schema' }}
COMPOSER_NAMESPACE: ${{ vars.COMPOSER_NAMESPACE || 'builtnorth/wp-schema' }}

jobs:
release:
name: Create Release
runs-on: ubuntu-latest
uses: builtnorth/.github/.github/workflows/composer-package-release.yml@main
with:
package-name: 'wp-schema'
package-display-name: 'WP Schema'
composer-namespace: 'builtnorth/wp-schema'
version: ${{ inputs.version }}
prerelease: ${{ inputs.prerelease }}
permissions:
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Determine version
id: version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
VERSION="${{ github.event.inputs.version }}"
if [[ ! "$VERSION" =~ ^v ]]; then
VERSION="v$VERSION"
fi
else
VERSION="${{ github.ref_name }}"
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "version_number=${VERSION#v}" >> $GITHUB_OUTPUT

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer:v2

# Skip composer.json version update - version tracked via git tags only
# This prevents merge conflicts between branches

- name: Update package.json version
if: contains(fromJSON('["package.json"]'), 'package.json')
run: |
if [ -f package.json ]; then
npm version ${{ steps.version.outputs.version_number }} --no-git-tag-version --allow-same-version
fi

- name: Commit version updates
if: github.event_name == 'workflow_dispatch'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"

# Skip adding composer.json - version tracked via git tags only
if [ -f package.json ]; then
git add package.json package-lock.json
fi

if ! git diff --cached --quiet; then
git commit -m "chore: bump version to ${{ steps.version.outputs.version_number }}"
git push origin HEAD:${{ github.ref_name }}
fi

- name: Create and push tag
if: github.event_name == 'workflow_dispatch'
run: |
git tag -a ${{ steps.version.outputs.version }} -m "Release ${{ steps.version.outputs.version }}"
git push origin ${{ steps.version.outputs.version }}

- name: Generate changelog
id: changelog
run: |
# Get the previous tag
PREVIOUS_TAG=$(git describe --tags --abbrev=0 ${{ steps.version.outputs.version }}^ 2>/dev/null || echo "")

if [ -z "$PREVIOUS_TAG" ]; then
echo "No previous tag found, including all commits"
COMMITS=$(git log --pretty=format:"- %s (%h)" --reverse)
else
echo "Generating changelog from $PREVIOUS_TAG to ${{ steps.version.outputs.version }}"
COMMITS=$(git log ${PREVIOUS_TAG}..${{ steps.version.outputs.version }} --pretty=format:"- %s (%h)" --reverse)
fi

# Format changelog
CHANGELOG="## What's Changed in ${{ env.PACKAGE_DISPLAY_NAME }} ${{ steps.version.outputs.version }}"
CHANGELOG="$CHANGELOG"$'\n\n'

# Group commits by type
FEATURES=$(echo "$COMMITS" | grep -E "^- (feat|feature):" || true)
FIXES=$(echo "$COMMITS" | grep -E "^- (fix|bugfix):" || true)
DOCS=$(echo "$COMMITS" | grep -E "^- (docs|documentation):" || true)
STYLE=$(echo "$COMMITS" | grep -E "^- (style|formatting):" || true)
REFACTOR=$(echo "$COMMITS" | grep -E "^- (refactor|refactoring):" || true)
TEST=$(echo "$COMMITS" | grep -E "^- (test|tests):" || true)
CHORE=$(echo "$COMMITS" | grep -E "^- (chore|build|ci):" || true)
OTHER=$(echo "$COMMITS" | grep -vE "^- (feat|feature|fix|bugfix|docs|documentation|style|formatting|refactor|refactoring|test|tests|chore|build|ci):" || true)

if [ -n "$FEATURES" ]; then
CHANGELOG="$CHANGELOG"$'\n'"### Features"$'\n'"$FEATURES"$'\n'
fi
if [ -n "$FIXES" ]; then
CHANGELOG="$CHANGELOG"$'\n'"### Bug Fixes"$'\n'"$FIXES"$'\n'
fi
if [ -n "$DOCS" ]; then
CHANGELOG="$CHANGELOG"$'\n'"### Documentation"$'\n'"$DOCS"$'\n'
fi
if [ -n "$REFACTOR" ]; then
CHANGELOG="$CHANGELOG"$'\n'"### Refactoring"$'\n'"$REFACTOR"$'\n'
fi
if [ -n "$TEST" ]; then
CHANGELOG="$CHANGELOG"$'\n'"### Tests"$'\n'"$TEST"$'\n'
fi
if [ -n "$CHORE" ]; then
CHANGELOG="$CHANGELOG"$'\n'"### Maintenance"$'\n'"$CHORE"$'\n'
fi
if [ -n "$OTHER" ]; then
CHANGELOG="$CHANGELOG"$'\n'"### Other Changes"$'\n'"$OTHER"$'\n'
fi

CHANGELOG="$CHANGELOG"$'\n'"**Full Changelog**: "
if [ -n "$PREVIOUS_TAG" ]; then
CHANGELOG="$CHANGELOG""https://github.com/${{ github.repository }}/compare/${PREVIOUS_TAG}...${{ steps.version.outputs.version }}"
else
CHANGELOG="$CHANGELOG""https://github.com/${{ github.repository }}/commits/${{ steps.version.outputs.version }}"
fi

# Save to file for the release
echo "$CHANGELOG" > release_notes.md

- name: Create release archive
run: |
# Create a clean release directory
mkdir -p release-archive

# Copy all files except those that should be excluded
rsync -av \
--exclude='.git' \
--exclude='.github' \
--exclude='composer.lock' \
--exclude='release-archive' \
--exclude='release_notes.md' \
--exclude='node_modules' \
--exclude='.env' \
--exclude='tests' \
--exclude='docs' \
--exclude='examples' \
--exclude='build' \
--exclude='.vscode' \
--exclude='.idea' \
--exclude='*.log' \
--exclude='.DS_Store' \
--exclude='Thumbs.db' \
--exclude='.gitignore' \
--exclude='.gitattributes' \
--exclude='phpunit.xml*' \
--exclude='phpstan.neon*' \
--exclude='.phpcs.xml*' \
--exclude='Makefile' \
--exclude='*.md' \
. release-archive/

# Create zip archive
cd release-archive
zip -r ../${{ env.PACKAGE_NAME }}-${{ steps.version.outputs.version_number }}.zip .
cd ..

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.version.outputs.version }}
name: ${{ steps.version.outputs.version }}
body_path: release_notes.md
draft: false
prerelease: ${{ github.event.inputs.prerelease == 'true' }}
generate_release_notes: false
files: |
${{ env.PACKAGE_NAME }}-${{ steps.version.outputs.version_number }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Release summary
if: success()
run: |
echo "Release created successfully!"
echo ""
echo "To use this version in other packages:"
echo ""
echo " \"require\": {"
echo " \"${{ env.COMPOSER_NAMESPACE }}\": \"${{ steps.version.outputs.version_number }}\""
echo " }"
echo ""
echo "With VCS repository:"
echo " \"repositories\": ["
echo " {"
echo " \"type\": \"vcs\","
echo " \"url\": \"https://github.com/${{ github.repository }}\""
echo " }"
echo " ]"
11 changes: 11 additions & 0 deletions .github/workflows/scheduled-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Scheduled CI

on:
schedule:
# Run every Monday at 10:00 AM ET (2:00 PM UTC)
- cron: '0 14 * * 1'
workflow_dispatch:

jobs:
scheduled-ci:
uses: builtnorth/.github/.github/workflows/composer-package-ci.yml@main
119 changes: 2 additions & 117 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,125 +1,10 @@
name: Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php-version: ['8.1', '8.2', '8.3', '8.4']

name: PHP ${{ matrix.php-version }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none
tools: composer:v2

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Validate composer.json
run: composer validate --strict --no-check-lock

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-interaction

- name: Security check for vulnerabilities
run: composer audit --no-dev

- name: Run PHPUnit tests
run: composer test

coverage:
name: Code Coverage
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
coverage: xdebug
tools: composer:v2

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-interaction

- name: Run PHPUnit with coverage
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
fail_ci_if_error: false

code-quality:
name: Code Quality
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
coverage: none
tools: composer:v2

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-interaction

- name: Run PHPCS coding standards check
run: composer lint

- name: Check PHP compatibility
run: composer phpcompat

test-status:
name: CI Status
runs-on: ubuntu-latest
needs: [test, coverage, code-quality]
if: always()

steps:
- name: Check results
run: |
if [ "${{ needs.test.result }}" == "success" ] && [ "${{ needs.code-quality.result }}" == "success" ] && [ "${{ needs.coverage.result }}" == "success" ]; then
echo "✅ All checks passed!"
exit 0
else
echo "❌ Some checks failed!"
[ "${{ needs.test.result }}" != "success" ] && echo " - Tests: Failed"
[ "${{ needs.coverage.result }}" != "success" ] && echo " - Coverage: Failed"
[ "${{ needs.code-quality.result }}" != "success" ] && echo " - Code Quality: Failed"
exit 1
fi
ci:
uses: builtnorth/.github/.github/workflows/composer-package-ci.yml@main
2 changes: 1 addition & 1 deletion .phpunit.result.cache

Large diffs are not rendered by default.

Loading