-
Notifications
You must be signed in to change notification settings - Fork 9
260 lines (218 loc) Β· 8.12 KB
/
Copy pathci.yml
File metadata and controls
260 lines (218 loc) Β· 8.12 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches: [main]
jobs:
validate-version:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Verify plugin.json#version bumped if skills/ or .claude-plugin/ changed
run: |
base=$(git show "$BASE_SHA":.claude-plugin/plugin.json | jq -r .version)
head=$(jq -r .version .claude-plugin/plugin.json)
echo "Base version: $base"
echo "Head version: $head"
if [ "$base" = "$head" ]; then
changed=$(git diff --name-only "$BASE_SHA"...HEAD | grep -E '^(skills/|\.claude-plugin/)' || true)
if [ -n "$changed" ]; then
echo ""
echo "β skills/ or .claude-plugin/ changed but plugin.json#version is still $head"
echo ""
echo "Changed files that require a version bump:"
echo "$changed" | sed 's/^/ /'
echo ""
echo "Bump .claude-plugin/plugin.json#version to publish a new release."
exit 1
fi
fi
echo "β
plugin version check passed"
- name: Verify SKILL.md#version bumped if skill content changed
if: always()
run: |
changed_skills=$(git diff --name-only "$BASE_SHA"...HEAD -- 'skills/*/**' \
| awk -F/ 'NF>=3 {print $2}' | sort -u)
if [ -z "$changed_skills" ]; then
echo "β
No skill content changed; per-skill version bump not required."
exit 0
fi
extract_version() {
awk '/^---$/{c++; next} c==1' | yq -r '.metadata.version // ""'
}
fail=0
for skill in $changed_skills; do
head_file="skills/$skill/SKILL.md"
if [ ! -f "$head_file" ]; then
echo "βΉοΈ $skill: SKILL.md missing on HEAD (skill deleted); skipping."
continue
fi
base_content=$(git show "$BASE_SHA:$head_file" 2>/dev/null || true)
if [ -z "$base_content" ]; then
echo "βΉοΈ $skill: new skill on this branch; skipping bump check."
continue
fi
head_v=$(extract_version < "$head_file")
base_v=$(printf '%s\n' "$base_content" | extract_version)
if [[ ! "$head_v" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "β $skill: SKILL.md metadata.version is not semver: '$head_v'"
fail=1
continue
fi
if [ "$head_v" = "$base_v" ] || ! printf '%s\n%s\n' "$base_v" "$head_v" | sort -V -C; then
echo "β $skill: content changed but SKILL.md metadata.version did not strictly increase ($base_v β $head_v). Bump the patch version for bug fixes."
fail=1
continue
fi
echo "β
$skill: $base_v β $head_v"
done
exit $fail
validate-spec:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Checkout agentskills repository
uses: actions/checkout@v6
with:
repository: agentskills/agentskills
path: agentskills
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: "pip"
cache-dependency-path: "agentskills/skills-ref/pyproject.toml"
- name: Install skills-ref
run: |
cd agentskills/skills-ref
pip install -e .
- name: Validate all skills
run: |
echo "π Validating all skills..."
find skills -name "SKILL.md" | while read -r skill_file; do
skill_dir=$(dirname "$skill_file")
skill_name=$(basename "$skill_dir")
echo ""
echo "Validating $skill_name..."
if skills-ref validate "$skill_dir"; then
echo "β
$skill_name is valid"
else
echo "β $skill_name validation failed"
exit 1
fi
done
echo ""
echo "β
All skills validated successfully"
validate-publish:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Ensure gh skill is available
run: |
if ! gh skill --help >/dev/null 2>&1; then
echo "Installing latest gh CLI..."
sudo mkdir -p -m 755 /etc/apt/keyrings
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg >/dev/null
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list >/dev/null
sudo apt-get update -qq
sudo apt-get install -y -qq gh
fi
gh --version | head -1
- name: Validate with gh skill
env:
GH_TOKEN: ${{ github.token }}
run: gh skill publish --dry-run
install-local:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install all skills (local)
working-directory: ${{ runner.temp }}
run: |
npx skills add "$GITHUB_WORKSPACE" --yes
echo "β
Successfully installed all skills from local repository"
- name: Verify all skill files
working-directory: ${{ runner.temp }}
run: |
echo "π Checking installed skill files..."
SKILLS_DIR=".agents/skills"
if [ ! -d "$SKILLS_DIR" ]; then
echo "β Skills directory not found: $SKILLS_DIR"
exit 1
fi
echo "β
Skills directory exists: $SKILLS_DIR"
SKILL_COUNT=0
for skill_dir in "$SKILLS_DIR"/*; do
if [ -d "$skill_dir" ]; then
skill_name=$(basename "$skill_dir")
echo ""
echo "π¦ Checking skill: $skill_name"
if [ -f "$skill_dir/SKILL.md" ]; then
echo " β
Found SKILL.md"
SKILL_COUNT=$((SKILL_COUNT + 1))
else
echo " β SKILL.md not found in $skill_dir"
exit 1
fi
fi
done
echo ""
echo "β
Successfully verified $SKILL_COUNT skills"
if [ $SKILL_COUNT -eq 0 ]; then
echo "β No skills were installed"
exit 1
fi
install-remote:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Install all skills from Skills.sh
run: |
npx skills add daleseo/korean-skills --yes
echo "β
Successfully installed all skills from GitHub"
- name: Verify all skill files
run: |
echo "π Checking installed skill files..."
SKILLS_DIR=".agents/skills"
if [ ! -d "$SKILLS_DIR" ]; then
echo "β Skills directory not found: $SKILLS_DIR"
exit 1
fi
echo "β
Skills directory exists: $SKILLS_DIR"
SKILL_COUNT=0
for skill_dir in "$SKILLS_DIR"/*; do
if [ -d "$skill_dir" ]; then
skill_name=$(basename "$skill_dir")
echo ""
echo "π¦ Checking skill: $skill_name"
if [ -f "$skill_dir/SKILL.md" ]; then
echo " β
Found SKILL.md"
SKILL_COUNT=$((SKILL_COUNT + 1))
else
echo " β SKILL.md not found in $skill_dir"
exit 1
fi
fi
done
echo ""
echo "β
Successfully verified $SKILL_COUNT skills"
if [ $SKILL_COUNT -eq 0 ]; then
echo "β No skills were installed"
exit 1
fi