Merge pull request #1 from AbdullahBakir97/feature/brain-professional… #14
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
| # Re-renders examples/rendered/extreme/*.svg whenever the widget code or the | |
| # extreme.yml config changes, then commits the result back to main. This keeps | |
| # the README's "What this generates" section honest — the embedded images are | |
| # always the actual output of the current code, never stale screenshots. | |
| name: Build examples | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'packages/cortex-core/**' | |
| - 'packages/cortex-cli/**' | |
| - 'examples/extreme.yml' | |
| - 'examples/standard.yml' | |
| - 'examples/minimal.yml' | |
| - '.github/workflows/build-examples.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| # Don't cancel mid-commit if another push lands. | |
| concurrency: | |
| group: build-examples | |
| cancel-in-progress: false | |
| jobs: | |
| render: | |
| name: Render and commit showcase SVGs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # Need write-back permission; default token works because the | |
| # workflow declares contents: write above. | |
| persist-credentials: true | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| cache: pip | |
| - name: Install Cortex packages | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e packages/cortex-core | |
| pip install -e packages/cortex-cli | |
| - name: Render extreme tier | |
| run: | | |
| mkdir -p examples/rendered/extreme | |
| cortex build -c examples/extreme.yml -o examples/rendered/extreme/ | |
| - name: Verify SVGs are well-formed | |
| run: | | |
| for f in examples/rendered/extreme/*.svg; do | |
| python -c "import xml.etree.ElementTree as ET; ET.parse('$f')" | |
| done | |
| - name: Commit if anything changed | |
| run: | | |
| git config user.name "cortex-bot[bot]" | |
| git config user.email "cortex-bot[bot]@users.noreply.github.com" | |
| git add examples/rendered/ | |
| if git diff --cached --quiet; then | |
| echo "::notice::No widget output drift — nothing to commit." | |
| else | |
| git commit -m "chore(examples): refresh rendered showcase" -m "Auto-generated by build-examples workflow." -m "[skip ci]" | |
| git push | |
| fi |