diff --git a/.github/workflows/generate-terminal-gifs.yaml b/.github/workflows/generate-terminal-gifs.yaml index e95fef4..ff655ae 100644 --- a/.github/workflows/generate-terminal-gifs.yaml +++ b/.github/workflows/generate-terminal-gifs.yaml @@ -8,18 +8,7 @@ permissions: pull-requests: write jobs: - run-tapes: - strategy: - matrix: - tapes: - - 'docs/vhs/install.tape' - - 'docs/vhs/basic-usage.tape' - - 'docs/vhs/yaml-config.tape' - - 'docs/vhs/mappings-demo.tape' - - 'docs/vhs/multiple-mappings.tape' - - 'docs/vhs/advanced-features.tape' - - 'docs/vhs/remote-content.tape' - - 'docs/vhs/schema-generation.tape' + generate-gifs: runs-on: ubuntu-latest steps: - name: Checkout @@ -32,16 +21,25 @@ jobs: with: python-version: '3.x' - - uses: charmbracelet/vhs-action@v2 - with: - path: ${{ matrix.tapes }} + - name: Install VHS + run: | + sudo mkdir -p /etc/apt/keyrings + curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg + echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list + sudo apt-get update && sudo apt-get install -y vhs + + - name: Generate GIFs + run: bash scripts/generate-gifs.sh - name: Create Pull Request uses: peter-evans/create-pull-request@v7 with: - commit-message: Update generated VHS GIF - branch: repository-dispatch/update-${{ github.run_id }} - title: Update generated VHS GIF - body: This PR updates the generated VHS GIF files. + commit-message: 'chore: update generated VHS GIFs' + branch: automation/update-vhs-gifs-${{ github.run_id }} + title: '[chore] update generated VHS GIFs' + body: | + This PR updates all generated VHS GIF files. + + Triggered by workflow run [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}). base: main labels: automation diff --git a/docs/vhs/advanced-features.gif b/docs/vhs/advanced-features.gif index f2b7b87..bb115d8 100644 Binary files a/docs/vhs/advanced-features.gif and b/docs/vhs/advanced-features.gif differ diff --git a/docs/vhs/advanced-features.tape b/docs/vhs/advanced-features.tape index ea3c024..70ad7fe 100644 --- a/docs/vhs/advanced-features.tape +++ b/docs/vhs/advanced-features.tape @@ -1,7 +1,7 @@ Output docs/vhs/advanced-features.gif Set Theme "Monokai Vivid" -Set FontSize 14 +Set FontSize 18 Set TypingSpeed 40ms Set Width 1400 Set Height 800 @@ -11,6 +11,10 @@ Type "# StructKit Advanced Features Demo" Enter Sleep 1s +Type "source .venv/bin/activate" +Enter +Sleep 500ms + Type "# Generate schema for VSCode autocompletion" Enter Type "mkdir -p .vscode" diff --git a/docs/vhs/basic-usage.tape b/docs/vhs/basic-usage.tape index 035405a..ddd3293 100644 --- a/docs/vhs/basic-usage.tape +++ b/docs/vhs/basic-usage.tape @@ -1,7 +1,7 @@ Output docs/vhs/usage.gif Set Theme "Dracula" -Set FontSize 14 +Set FontSize 18 Set Width 1200 Set Height 600 Set Shell "bash" @@ -10,6 +10,10 @@ Type "# StructKit - Basic Usage Demo" Enter Sleep 1s +Type "source .venv/bin/activate" +Enter +Sleep 500ms + Type "# First, let's see what structures are available" Enter Sleep 500ms diff --git a/docs/vhs/install.gif b/docs/vhs/install.gif index c0cd497..94d5309 100644 Binary files a/docs/vhs/install.gif and b/docs/vhs/install.gif differ diff --git a/docs/vhs/install.tape b/docs/vhs/install.tape index f618fdd..8376d15 100644 --- a/docs/vhs/install.tape +++ b/docs/vhs/install.tape @@ -2,7 +2,7 @@ Output docs/vhs/install.gif Set Theme "Monokai Vivid" -Set FontSize 14 +Set FontSize 18 Set TypingSpeed 40ms Set Width 1400 Set Height 800 diff --git a/docs/vhs/mappings-demo.gif b/docs/vhs/mappings-demo.gif index 17418e8..e88ad1e 100644 Binary files a/docs/vhs/mappings-demo.gif and b/docs/vhs/mappings-demo.gif differ diff --git a/docs/vhs/mappings-demo.tape b/docs/vhs/mappings-demo.tape index 1868f0b..b7c63f1 100644 --- a/docs/vhs/mappings-demo.tape +++ b/docs/vhs/mappings-demo.tape @@ -1,7 +1,7 @@ Output docs/vhs/mappings-demo.gif Set Theme "Monokai Vivid" -Set FontSize 14 +Set FontSize 18 Set TypingSpeed 40ms Set Width 1400 Set Height 800 @@ -11,6 +11,10 @@ Type "# StructKit Mappings Demo" Enter Sleep 1s +Type "source .venv/bin/activate" +Enter +Sleep 500ms + Type "# Create a simple mapping file with team data" Enter Type "cat > team-mapping.yaml << EOF" diff --git a/docs/vhs/multiple-mappings.gif b/docs/vhs/multiple-mappings.gif index f0726d2..2d242f3 100644 Binary files a/docs/vhs/multiple-mappings.gif and b/docs/vhs/multiple-mappings.gif differ diff --git a/docs/vhs/multiple-mappings.tape b/docs/vhs/multiple-mappings.tape index 08f8eec..09531ef 100644 --- a/docs/vhs/multiple-mappings.tape +++ b/docs/vhs/multiple-mappings.tape @@ -1,7 +1,7 @@ Output docs/vhs/multiple-mappings.gif Set Theme "Monokai Vivid" -Set FontSize 14 +Set FontSize 18 Set TypingSpeed 40ms Set Width 1400 Set Height 800 @@ -11,6 +11,10 @@ Type "# StructKit Multiple Mappings Demo" Enter Sleep 1s +Type "source .venv/bin/activate" +Enter +Sleep 500ms + Type "# Create company info mapping" Enter Type "cat > company-info.yaml << EOF" diff --git a/docs/vhs/remote-content.gif b/docs/vhs/remote-content.gif index e998cb5..153b5cf 100644 Binary files a/docs/vhs/remote-content.gif and b/docs/vhs/remote-content.gif differ diff --git a/docs/vhs/remote-content.tape b/docs/vhs/remote-content.tape index 74e4322..e87093e 100644 --- a/docs/vhs/remote-content.tape +++ b/docs/vhs/remote-content.tape @@ -1,7 +1,7 @@ Output docs/vhs/remote-content.gif Set Theme "Monokai Vivid" -Set FontSize 14 +Set FontSize 18 Set TypingSpeed 40ms Set Width 1400 Set Height 800 @@ -11,6 +11,10 @@ Type "# StructKit Remote Content Demo" Enter Sleep 1s +Type "source .venv/bin/activate" +Enter +Sleep 500ms + Type "# Create configuration with remote files" Enter Type "cat > remote-example.yaml << EOF" diff --git a/docs/vhs/schema-generation.gif b/docs/vhs/schema-generation.gif index d54c196..9052927 100644 Binary files a/docs/vhs/schema-generation.gif and b/docs/vhs/schema-generation.gif differ diff --git a/docs/vhs/schema-generation.tape b/docs/vhs/schema-generation.tape index 4edce85..9d82a32 100644 --- a/docs/vhs/schema-generation.tape +++ b/docs/vhs/schema-generation.tape @@ -1,7 +1,7 @@ Output docs/vhs/schema-generation.gif Set Theme "Monokai Vivid" -Set FontSize 14 +Set FontSize 18 Set TypingSpeed 40ms Set Width 1400 Set Height 800 @@ -11,6 +11,10 @@ Type "# StructKit Schema Generation Demo" Enter Sleep 1s +Type "source .venv/bin/activate" +Enter +Sleep 500ms + Type "# Generate JSON schema for VSCode autocompletion" Enter Type "structkit generate-schema" diff --git a/docs/vhs/usage.gif b/docs/vhs/usage.gif index 90e5aaa..50601a6 100644 Binary files a/docs/vhs/usage.gif and b/docs/vhs/usage.gif differ diff --git a/docs/vhs/yaml-config.gif b/docs/vhs/yaml-config.gif index cae4325..e1c2bdf 100644 Binary files a/docs/vhs/yaml-config.gif and b/docs/vhs/yaml-config.gif differ diff --git a/docs/vhs/yaml-config.tape b/docs/vhs/yaml-config.tape index e89f7d4..c5b7d98 100644 --- a/docs/vhs/yaml-config.tape +++ b/docs/vhs/yaml-config.tape @@ -1,7 +1,7 @@ Output docs/vhs/yaml-config.gif Set Theme "Monokai Vivid" -Set FontSize 14 +Set FontSize 18 Set TypingSpeed 40ms Set Width 1400 Set Height 800 @@ -11,6 +11,10 @@ Type "# StructKit YAML Configuration Demo" Enter Sleep 1s +Type "source .venv/bin/activate" +Enter +Sleep 500ms + Type "# Create a simple project structure configuration" Enter Type "cat > my-project.yaml << EOF" diff --git a/scripts/generate-gifs.sh b/scripts/generate-gifs.sh new file mode 100755 index 0000000..dff864c --- /dev/null +++ b/scripts/generate-gifs.sh @@ -0,0 +1,44 @@ +#!/bin/bash +set -e + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" + +cd "$PROJECT_ROOT" + +echo "==> Running VHS tapes..." +for tape in docs/vhs/*.tape; do + echo " Running: $tape" + vhs "$tape" +done + +echo "==> Cleaning up demo artifacts..." + +# Files created by tapes (skip any that are git-tracked) +for f in \ + remote-demo.yaml \ + remote-example.yaml \ + project-with-mapping.yaml \ + team-mapping.yaml \ + company-info.yaml \ + environments.yaml \ + multi-mapping-project.yaml \ + my-project.yaml \ + .vscode/struct-schema.json \ + .vscode/struct-plugins.schema.json; do + git ls-files --error-unmatch "$f" &>/dev/null || rm -f "$f" +done + +# Directories created by tapes +rm -rf \ + remote-project/ \ + remote-demo/ \ + my-python-app/ \ + backend-project/ \ + dev-app/ \ + my-custom-project/ + +# Remove .vscode dir if now empty +[ -d .vscode ] && rmdir --ignore-fail-on-non-empty .vscode + +echo "==> Done! GIFs are in docs/vhs/"