chore(ci): add ClawHub publish workflow and script

- Add clawhub-publish.sh to publish all skills with version > 0.0.0
- Refactor workflow to use the shared script
- Add WIP skills with version 0.0.0 (skipped by publish)
This commit is contained in:
Samuel Berthe
2026-03-22 16:24:10 +01:00
parent fe55d9e692
commit 8689fc90a4
2 changed files with 29 additions and 26 deletions
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -euo pipefail
if [ -n "${CLAWHUB_TOKEN:-}" ]; then
npx -y clawhub login --token "$CLAWHUB_TOKEN"
fi
for skill_dir in skills/*/; do
skill_name=$(basename "$skill_dir")
skill_file="${skill_dir}SKILL.md"
if [ ! -f "$skill_file" ]; then
echo "Skipping ${skill_name}: no SKILL.md found"
continue
fi
# Parse version from frontmatter
version=$(awk '/^---$/{c++; next} c==1 && /^[[:space:]]*version:/{gsub(/[" ]/, "", $2); print $2; exit}' "$skill_file")
if [ -z "$version" ] || [ "$version" = "0.0.0" ]; then
echo "Skipping ${skill_name}: no version or version is 0.0.0"
continue
fi
echo "Publishing ${skill_name} v${version}"
npx -y clawhub publish "$PWD/${skill_dir}" --version "$version" || true
done