Add WanMove template #131
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Version Check and Auto-bump | |
| # This workflow automatically bumps package versions when templates change. | |
| # | |
| # Process: | |
| # 1. Syncs manifests with SHA256 hashes (updates core package manifest.json) | |
| # 2. Validates bundles.json completeness | |
| # 3. Detects which packages have template changes (via git history) | |
| # 4. Bumps version numbers for affected packages (including core if manifest changed) | |
| # 5. Updates meta package dependencies (exact pinning) | |
| # 6. Commits changes back to PR branch | |
| # | |
| # Critical: sync_bundles.py validates that ALL templates are assigned to bundles | |
| # Note: Manifest sync must run BEFORE version detection so core package changes are detected | |
| on: | |
| pull_request: | |
| types: [opened, synchronize] | |
| paths: | |
| - 'templates/**' | |
| - 'bundles.json' | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| version-check: | |
| runs-on: ubuntu-latest | |
| # Prevent concurrent version-check runs on same PR (unique per fork+branch) | |
| concurrency: | |
| group: version-check-${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.repo.full_name }} | |
| cancel-in-progress: true | |
| steps: | |
| - name: Checkout PR | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| ref: ${{ github.head_ref }} | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.x" | |
| - name: Sync manifests and bundles (first) | |
| run: | | |
| echo "=== Validating bundles.json and syncing manifests ===" | |
| # This step validates that all templates are assigned to bundles | |
| # and generates updated manifest files with SHA256 hashes | |
| # Must run BEFORE version detection so core package manifest.json changes are detected | |
| python scripts/sync_bundles.py | |
| echo "✅ Manifest sync complete" | |
| - name: Auto-bump package versions if needed | |
| run: | | |
| echo "=== Analyzing template changes and bumping versions ===" | |
| # This runs AFTER manifest sync so it can detect core package changes | |
| python scripts/ci_version_manager.py | |
| echo "✅ Version analysis complete" | |
| - name: Commit version bumps and manifest updates to PR | |
| run: | | |
| echo "=== Committing automated changes to PR ===" | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| # Stage all potential changes from version bumps and manifest sync | |
| git add pyproject.toml packages/*/pyproject.toml packages/*/src/*/manifest.json | |
| if ! git diff --cached --quiet; then | |
| echo "📝 Changes detected - committing to PR branch" | |
| # Commit with retry logic in case of conflicts | |
| if ! git commit -m "Auto-bump package versions and sync manifests for template changes"; then | |
| echo "⚠️ Commit failed, possibly due to conflicts. Retrying..." | |
| if ! git pull origin "${{ github.head_ref }}" --rebase; then | |
| echo "❌ Rebase failed due to conflicts. Manual intervention required." | |
| git status | |
| exit 1 | |
| fi | |
| git commit -m "Auto-bump package versions and sync manifests for template changes" | |
| fi | |
| # Push with retry logic | |
| if ! git push origin HEAD; then | |
| echo "⚠️ Push failed, retrying after pull..." | |
| if ! git pull origin "${{ github.head_ref }}" --rebase; then | |
| echo "❌ Rebase failed due to conflicts. Manual intervention required." | |
| git status | |
| exit 1 | |
| fi | |
| git push origin HEAD | |
| fi | |
| echo "✅ Package version bumps and manifest updates committed to PR" | |
| else | |
| echo "✅ No package version or manifest changes needed" | |
| fi |