feat: improve magic file processing and clean up registry entries #5
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: Update model registry | |
| on: | |
| push: | |
| paths: | |
| - "magic/upload/*.magic" | |
| - "scripts/update_registry.py" | |
| - ".github/workflows/registry.yml" | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-registry: | |
| runs-on: ubuntu-latest | |
| env: | |
| DEFAULT_BRANCH: main | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install deps (none needed) | |
| run: python -V | |
| - name: Update manifest.json | |
| run: python scripts/update_registry.py | |
| - name: Commit manifest.json if changed | |
| run: | | |
| if [[ -n "$(git status --porcelain magic/manifest.json)" ]]; then | |
| git config user.name "github-actions[bot]" | |
| git config user.email "[email protected]" | |
| git add magic/manifest.json | |
| git commit -m "chore(manifest): update after new .magic" | |
| git push | |
| else | |
| echo "No changes to commit." | |
| fi |