Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schema_version": 2,
"authority": "https://github.com/computer-mcp/.github",
"revision": "fe16fb823ef36fd1853ec1844b02d360ac203a1323054b79232fc7e1057c3563",
"revision": "9042c987ef8b3482f63e3a037ae0d0d2fdeffb9a7768c03295c9a6a6c5a43ae2",
"consumer": ".github",
"files": {
"profile/brand/header-light.png": "821b9c5a2ad1a821acef6ffd9d035d3d856b17314f0bd9adb863ce77b52060f2",
Expand Down
13 changes: 3 additions & 10 deletions .github/workflows/brand-check.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: Brand
on:
workflow_call:
inputs:
lock:
description: Brand lock path in the calling repository
type: string
default: Documentation/Brand/brand.lock.json
permissions:
contents: read
jobs:
Expand All @@ -17,17 +12,15 @@ jobs:
with:
persist-credentials: false
- name: Verify locked brand delivery
env:
LOCK: ${{ inputs.lock }}
run: |
python3 - "$LOCK" <<'PY'
python3 - <<'PY'
import hashlib, json, sys
from pathlib import Path

root = Path.cwd().resolve()
lock = json.loads((root / sys.argv[1]).read_text())
lock = json.loads((root / ".github/brand/brand.lock.json").read_text())
if lock.get("schema_version") != 2 or lock.get("authority") != "https://github.com/computer-mcp/.github":
sys.exit(f"{sys.argv[1]} is not a Computer MCP brand lock")
sys.exit(".github/brand/brand.lock.json is not a Computer MCP brand lock")
errors = []
for name, expected in lock["files"].items():
path = (root / name).resolve()
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@ jobs:
run: python3 Brand/brand.py check
profile:
uses: ./.github/workflows/brand-check.yml
with:
lock: profile/brand/brand.lock.json
2 changes: 1 addition & 1 deletion Brand/Exports/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"schema_version": 1,
"inputs": {
"DESIGN.md": "baf0318de7b9fb5e9b24d9201e806ec9545dc526e3c79197dcfa0e83f0ddf220",
"Brand/config.json": "06f0dc75d3f2e890180271293751452782c1504241a5ec1ff028f22b727f0bd0",
"Brand/config.json": "e116853724002cc2e1dbfbe4e092cf26d4922e11b51911408307fb47379443e5",
"Brand/icons.mjs": "1c3676dcdc5fdcaf81daa096dc61a536be2f02704748d3c02bda918fb26cb97d",
"Brand/render.mjs": "a8927cab0db45f9326f353fba40ea3bcbb326b6a0508a53b7e3bafbbe7d14dc4",
"Brand/package.json": "c5d5e11a37021178ac682ce2fd64a2f55dc4dfe4f333b64f0079cb1ef54686cd",
Expand Down
9 changes: 5 additions & 4 deletions Brand/brand.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
ROOT = BRAND.parent
EXPORTS = BRAND / "Exports"
VERIFIER = ROOT / ".github/workflows/brand-check.yml"
LOCK = ".github/brand/brand.lock.json"
CONFIG = json.loads((BRAND / "config.json").read_text())


Expand Down Expand Up @@ -88,10 +89,10 @@ def inside(root, name):
return path


def verify(root, lock):
def verify(root):
workflow = VERIFIER.read_text()
script = workflow.split("<<'PY'\n", 1)[1].split("\n PY\n", 1)[0]
return subprocess.run([sys.executable, "-", lock], input=textwrap.dedent(script), text=True, cwd=root).returncode
return subprocess.run([sys.executable, "-"], input=textwrap.dedent(script), text=True, cwd=root).returncode


def sync(checkout, repository):
Expand All @@ -100,7 +101,7 @@ def sync(checkout, repository):
root = Path(checkout).resolve()
repository = repository or repository_of(root)
spec, entries = resolve(repository)
lock_path = inside(root, spec["lock"])
lock_path = inside(root, LOCK)
previous = json.loads(lock_path.read_text())["files"] if lock_path.exists() else {}
files = {}
for target, source in deliveries(spec):
Expand All @@ -121,7 +122,7 @@ def sync(checkout, repository):
lock_path.parent.mkdir(parents=True, exist_ok=True)
lock_path.write_text(json.dumps(lock, indent=2, ensure_ascii=False) + "\n")
print(f"Delivered {len(files)} brand files to {repository}", flush=True)
return verify(root, spec["lock"])
return verify(root)


def main():
Expand Down
13 changes: 3 additions & 10 deletions Brand/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@
],
"consumers": {
".github": {
"lock": "profile/brand/brand.lock.json",
"files": {
"profile/brand/header-light.png": "headers/computer-mcp-light.png",
"profile/brand/header-dark.png": "headers/computer-mcp-dark.png",
Expand All @@ -116,15 +115,13 @@
}
},
"computer-mcp": {
"lock": "Documentation/Brand/brand.lock.json",
"files": {
"Documentation/Brand/header-light.png": "headers/computer-mcp-light.png",
"Documentation/Brand/header-dark.png": "headers/computer-mcp-dark.png",
"Documentation/Brand/header-zh-CN-light.png": "headers/computer-mcp-zh-CN-light.png",
"Documentation/Brand/header-zh-CN-dark.png": "headers/computer-mcp-zh-CN-dark.png",
"Documentation/Brand/social.png": "social/computer-mcp.png",
"Documentation/Brand/social-zh-CN.png": "social/computer-mcp-zh-CN.png",
"Documentation/Brand/icon.png": "app/app-icon.png",
".github/brand/social.png": "social/computer-mcp.png",
".github/brand/social-zh-CN.png": "social/computer-mcp-zh-CN.png",
"Resources/ComputerMCPApp/AppIcon.icon/": "app/AppIcon.icon/"
},
"entries": {
Expand All @@ -133,7 +130,6 @@
}
},
"computer-mcp.github.io": {
"lock": "public/brand/brand.lock.json",
"files": {
"public/brand/icon.svg": "app/app-icon.svg",
"public/brand/favicon.svg": "web/favicon.svg",
Expand All @@ -154,13 +150,10 @@
}
},
"@member": {
"lock": "Documentation/Brand/brand.lock.json",
"files": {
"Documentation/Brand/header-light.png": "headers/{repository}-light.png",
"Documentation/Brand/header-dark.png": "headers/{repository}-dark.png",
"Documentation/Brand/social.png": "social/{repository}.png",
"Documentation/Brand/icon.svg": "icons/{repository}.svg",
"Documentation/Brand/icon.png": "icons/{repository}.png"
".github/brand/social.png": "social/{repository}.png"
},
"entries": {
"README.md": ["@title", "Documentation/Brand/header-light.png", "Documentation/Brand/header-dark.png"]
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ Text rendered into images (`Brand/config.json` `copy` and `members`) must match

`python3 Brand/brand.py sync <checkout>` copies the files that repository uses,
removes files its previous lock delivered and no longer needs, rewrites its
`brand.lock.json`, and verifies the lock. Commit the result through a pull
request in that repository. Each repository's CI calls the shared check:
`.github/brand/brand.lock.json`, and verifies the lock. Images that ship with a
repository's packaged documentation live in `Documentation/Brand/`; social
previews stay in `.github/brand/`. Commit the result through a pull request in
that repository. Each repository's CI calls the shared check:

```yaml
jobs:
brand:
uses: computer-mcp/.github/.github/workflows/brand-check.yml@<commit>
with:
lock: Documentation/Brand/brand.lock.json
```