mirror of
https://github.com/samber/cc-skills-golang.git
synced 2026-09-11 19:46:44 +03:00
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:
Executable
+27
@@ -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
|
||||
Reference in New Issue
Block a user