Files
diagram-design/.github/workflows/ci.yml
T
Cathryn Lavery b6cae1e2e6 feat(plugin): automatic updates via native marketplaces and a version gate
Installs previously drifted: a standalone `npx skills add` copy never
followed the repo, and Claude Code disables auto-update for third-party
marketplaces by default. Route every client through its own marketplace so
merged changes reach users through the native update path.

- Add `.agents/plugins/marketplace.json` so Codex resolves the plugin from
  a Git marketplace it refreshes at startup.
- Add `author` to the Claude manifest so both native manifests agree.
- Add `scripts/bump-plugin-version.py` to increment the Claude and Codex
  versions together; it refuses to run when they already differ.
- Add `scripts/verify-plugin-package.py` to gate synchronized, strictly
  increasing semver against the base ref, marketplace paths that stay
  inside the repo root, and the packaged skill.
- Add `scripts/test-plugin-package.py` covering the adversarial cases:
  missing bump, mismatched manifests, malformed semver, and a marketplace
  target that does not exist.
- Add a `plugin-package` CI job running the tests, the version gate against
  the PR base sha, and `claude plugin validate . --strict`.
- Document the per-PR bump requirement, the new gates, and the per-client
  install/update paths, including the one-time migration off standalone
  copies.

Version bumps 2.3.0 -> 2.3.1 to satisfy the new gate.
2026-08-12 20:34:32 -07:00

187 lines
8.0 KiB
YAML

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
env:
PYTHONIOENCODING: utf-8
PYTHONUTF8: "1"
jobs:
plugin-package:
name: Plugin Package & Version Gate
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository history
uses: actions/checkout@v4
env:
GIT_CONFIG_COUNT: "1"
GIT_CONFIG_KEY_0: "core.autocrlf"
GIT_CONFIG_VALUE_0: "false"
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Test plugin package tooling
run: python3 scripts/test-plugin-package.py
- name: Require a synchronized plugin version bump
env:
BASE_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
run: python3 scripts/verify-plugin-package.py "$BASE_REF"
- name: Validate Claude marketplace package without warnings
run: npx --yes @anthropic-ai/claude-code@2.1.229 plugin validate . --strict
validate:
name: Lint & Verify (${{ matrix.os }}, Python ${{ matrix.python-version }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.11", "3.12"]
runs-on: ${{ matrix.os }}
timeout-minutes: 20
steps:
- name: Checkout repository
uses: actions/checkout@v4
env:
GIT_CONFIG_COUNT: "1"
GIT_CONFIG_KEY_0: "core.autocrlf"
GIT_CONFIG_VALUE_0: "false"
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Verify accessible SVG contract
if: always()
id: a11y
run: python scripts/test-lint-a11y.py
- name: Verify semantic pattern documentation
if: always()
id: semantic_docs
run: python scripts/verify-semantic-motion.py --markdown-only
- name: Verify animated example structure
if: always()
id: animated_example
run: python scripts/verify-semantic-motion.py --example-only
- name: Lint animated example skin
if: always()
id: animated_lint
run: python scripts/lint-skin.py skills/diagram-design/assets/example-policy-trace-animated.html
- name: Verify every shipped motion file
if: always()
id: shipped_motion
run: python scripts/verify-motion.py --shipped
- name: Verify URL SVG normalization
if: always()
id: url_icons
run: python scripts/test-build-icons-quoted-attributes.py
- name: Verify Devicon normalization
if: always()
id: devicon
run: python scripts/test-build-icons-devicon.py
- name: Verify mojibake repair utility
if: always()
id: mojibake
run: python scripts/test-fix-mojibake.py
- name: Run skin linter
if: always()
id: skin
run: python scripts/lint-skin.py --all --baseline
- name: Verify sequence OAuth specs
if: always()
id: oauth
run: python scripts/verify-sequence-oauth.py
- name: Verify draw.io import script
if: always()
id: drawio
run: python scripts/verify-drawio-import.py
- name: Verify Mermaid import script
if: always()
id: mermaid
run: python scripts/verify-mermaid-import.py
- name: Verify optional motion contract
if: always()
id: motion
run: python scripts/test-verify-motion.py
- name: Verify docs and routing sync
if: always()
id: docs_sync
run: python scripts/verify-docs-sync.py
- name: Verify packaged self-check
if: always()
id: self_check
run: python scripts/test-self-check.py
- name: Verify generated icon assets
if: always()
id: icons
shell: bash
run: |
python scripts/build-icons.py
git diff --ignore-space-at-eol --exit-code -- \
skills/diagram-design/assets/icons.html \
skills/diagram-design/references/primitive-icons.md
- name: Generate CI execution summary table
if: always()
shell: bash
run: |
echo "### 📊 CI Verification Summary (${{ matrix.os }}, Python ${{ matrix.python-version }})" >> $GITHUB_STEP_SUMMARY
echo "| Verification Gate | Outcome |" >> $GITHUB_STEP_SUMMARY
echo "|---|---|" >> $GITHUB_STEP_SUMMARY
echo "| SVG Accessibility Contract | ${{ steps.a11y.outcome == 'success' && '✅ Passed' || (steps.a11y.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARY
echo "| Semantic Pattern Documentation | ${{ steps.semantic_docs.outcome == 'success' && '✅ Passed' || (steps.semantic_docs.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARY
echo "| Animated Example Structure | ${{ steps.animated_example.outcome == 'success' && '✅ Passed' || (steps.animated_example.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARY
echo "| Animated Example Skin | ${{ steps.animated_lint.outcome == 'success' && '✅ Passed' || (steps.animated_lint.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARY
echo "| Shipped Motion HTML | ${{ steps.shipped_motion.outcome == 'success' && '✅ Passed' || (steps.shipped_motion.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARY
echo "| URL SVG Normalization | ${{ steps.url_icons.outcome == 'success' && '✅ Passed' || (steps.url_icons.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARY
echo "| Devicon Normalization | ${{ steps.devicon.outcome == 'success' && '✅ Passed' || (steps.devicon.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARY
echo "| Mojibake Repair Utility | ${{ steps.mojibake.outcome == 'success' && '✅ Passed' || (steps.mojibake.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARY
echo "| Color Palette & Skin Linter | ${{ steps.skin.outcome == 'success' && '✅ Passed' || (steps.skin.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARY
echo "| Sequence Diagram Grammar | ${{ steps.oauth.outcome == 'success' && '✅ Passed' || (steps.oauth.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARY
echo "| Draw.io Import Extractor | ${{ steps.drawio.outcome == 'success' && '✅ Passed' || (steps.drawio.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARY
echo "| Mermaid Import Extractor | ${{ steps.mermaid.outcome == 'success' && '✅ Passed' || (steps.mermaid.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARY
echo "| Optional Motion Contract | ${{ steps.motion.outcome == 'success' && '✅ Passed' || (steps.motion.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARY
echo "| Docs & Routing Sync | ${{ steps.docs_sync.outcome == 'success' && '✅ Passed' || (steps.docs_sync.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARY
echo "| Packaged Self-Check | ${{ steps.self_check.outcome == 'success' && '✅ Passed' || (steps.self_check.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARY
echo "| Primitive Icons & Documentation | ${{ steps.icons.outcome == 'success' && '✅ Passed' || (steps.icons.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARY