axterminator 0.10.1

macOS GUI testing framework with background testing, sub-millisecond element access, and self-healing locators
name: Generate Demo GIF

on:
  workflow_dispatch:  # Manual trigger
  push:
    paths:
      - 'demo/**'
      - '.github/workflows/demo.yml'

jobs:
  generate-gif:
    runs-on: macos-latest
    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: Set up Python
        uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
        with:
          python-version: '3.12'

      - name: Install VHS
        run: brew install vhs

      - name: Generate Demo GIF
        run: |
          cd demo
          vhs demo.tape

      - name: Upload GIF artifact
        uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
        with:
          name: demo-gif
          path: demo/axterminator_demo.gif
          retention-days: 30

      - name: Commit GIF (if on main)
        if: github.ref == 'refs/heads/main'
        run: |
          git config user.name "github-actions[bot]"
          git config user.email "github-actions[bot]@users.noreply.github.com"
          if [ -f demo/axterminator_demo.gif ]; then
            git add demo/axterminator_demo.gif
            git diff --staged --quiet || git commit -m "Update demo GIF [skip ci]"
            git push
          fi