Repository navigation
75 lines (69 loc) · 2.68 KB
/
Copy pathplugin-install.yml
File metadata and controls
75 lines (69 loc) · 2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Plugin installation
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
schedule:
- cron: '0 1 * * *'
permissions:
contents: read
jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Resolve Codex CLI version
id: codex-version
run: |
version="$(npm view @openai/codex version)"
if [ -z "$version" ] || [ "$version" = "null" ]; then
echo "Failed to resolve @openai/codex version" >&2
exit 1
fi
echo "version=${version}" >> "$GITHUB_OUTPUT"
echo "codex npm version: ${version}"
- name: Install Codex CLI
env:
CODEX_VERSION: ${{ steps.codex-version.outputs.version }}
run: |
npm install --global "@openai/codex@${CODEX_VERSION}"
codex --version
{
echo "codex npm version: ${CODEX_VERSION}"
echo "codex --version: $(codex --version)"
} >> "$GITHUB_STEP_SUMMARY"
- name: Install the marketplace and check the bundled skills
shell: python
run: |
import json
import os
from pathlib import Path
import subprocess
import tempfile
root = Path.cwd()
with tempfile.TemporaryDirectory(prefix="pstack-install-") as home:
env = dict(os.environ, CODEX_HOME=home)
def codex(*args):
result = subprocess.run(
["codex", "plugin", *args, "--json"],
env=env, check=True, capture_output=True, text=True,
timeout=60,
)
return json.loads(result.stdout)
codex("marketplace", "add", str(root))
plugin = codex("add", "pstack@codex-pstack")
installed = Path(plugin["installedPath"])
manifest = json.loads((installed / ".codex-plugin/plugin.json").read_text())
skill_root = installed / manifest["skills"]
skills = {p.parent.name for p in skill_root.glob("*/SKILL.md")}
required = {"poteto-mode", "setup-pstack", "deslop", "control-cli", "control-ui"}
assert required <= skills, f"Missing skills: {required - skills}"
for source in (root / ".agents").rglob("*"):
if source.is_file():
target = installed / source.relative_to(root)
assert target.read_bytes() == source.read_bytes(), f"Missing or changed: {target}"
print(f"Installed {plugin['pluginId']} with {len(skills)} skills")