diff --git a/.github/workflows/distribute.yml b/.github/workflows/distribute.yml index d9125db..3b9b7ed 100644 --- a/.github/workflows/distribute.yml +++ b/.github/workflows/distribute.yml @@ -1,11 +1,12 @@ name: Distribute on release # Fans a published GitHub Release out to the channels that need a nudge. -# PyPI is handled by publish.yml. This workflow event-drives the three channels +# PyPI is handled by publish.yml. This workflow event-drives the four channels # that would otherwise be manual: # - Homebrew tap: rewrite the formula's url + sha256 to the new sdist. # - HF Space: factory-rebuild the version already pinned in the Space repo. # - ComfyUI: sync, test, and publish the node against the exact library release. +# - ClawHub: publish the agent skill when its own version moved. # All wait for the freshly published sdist to appear on PyPI first, since the # Release event fires in parallel with publish.yml's upload. @@ -106,6 +107,44 @@ jobs: print("HF Space factory rebuild triggered") PY + clawhub: + needs: resolve + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - name: Publish the agent skill when its version moved + env: + CLAWHUB_TOKEN: ${{ secrets.CLAWHUB_TOKEN }} + run: | + set -euo pipefail + if [ -z "${CLAWHUB_TOKEN:-}" ]; then + echo "CLAWHUB_TOKEN secret is not set; skipping ClawHub publish." + exit 0 + fi + npm install --silent --no-fund --no-audit clawhub + skill_version=$(python3 - <<'PY' + import re + text = open("skills/remove-ai-watermarks/SKILL.md", encoding="utf-8").read() + m = re.search(r"(?m)^ version:\s*[\"']?([^\"'\s]+)", text) + assert m, "skill version missing" + print(m.group(1)) + PY + ) + clawhub login --token "$CLAWHUB_TOKEN" >/dev/null + published=$(clawhub inspect remove-ai-watermarks --file SKILL.md 2>/dev/null \ + | python3 -c 'import re,sys; t=sys.stdin.read(); m=re.search(r"(?m)^ version:\s*[\"'"'"']?([^\"'"'"'\s]+)", t); print(m.group(1) if m else "")' || true) + if [ "$published" = "$skill_version" ]; then + echo "ClawHub already at $skill_version; nothing to publish." + exit 0 + fi + echo "ClawHub at ${published:-}; publishing skill $skill_version." + clawhub skill publish skills/remove-ai-watermarks \ + --slug remove-ai-watermarks \ + --name "Remove AI Watermarks" \ + --version "$skill_version" \ + --changelog "Agent skill sync for the ${{ github.event.release.name || github.ref_name }} release." + echo "Submitted; ClawHub runs security scans before the listing goes public." + comfyui: needs: resolve runs-on: ubuntu-latest diff --git a/docs/release-and-distribution.md b/docs/release-and-distribution.md index 16ac609..09b67f5 100644 --- a/docs/release-and-distribution.md +++ b/docs/release-and-distribution.md @@ -147,9 +147,16 @@ After the skill files reach the default branch: - SkillsMP can index the public `SKILL.md`; - Claude Code users can run `/plugin marketplace add wiltodelta/remove-ai-watermarks`. -ClawHub and the Claude community marketplace need a separate authenticated -publish. Do not treat those listings as complete until the live catalog shows -the skill. +ClawHub publishes automatically: the `clawhub` job in `distribute.yml` compares +the `SKILL.md` version with the published one on every GitHub Release and +submits an update when they differ. It needs the `CLAWHUB_TOKEN` secret +(create a dedicated token on clawhub.ai, not a device-flow one); without +the secret the job skips with a notice. A submission waits for ClawHub +security scans before the listing goes public, so a green job means +"submitted", not "listed": verify the live catalog before calling the +surface complete. The Claude community marketplace remains a manual, +authenticated publish. Do not treat any listing as complete until the live +catalog shows the skill. ## Release verification