← Files AMDARCHIVED FILE

.github/scripts/publish.sh

1.62 KB · Sep 30, 2026 · 23:13 UTC

↓ Download file

#!/usr/bin/env bash
# Regenerate every committed artifact derived from skills/ and the
# canonical marketplace + metadata sources.
#
# Usage:
#   ./.github/scripts/publish.sh            Regenerate all derived artifacts.
#   ./.github/scripts/publish.sh --check    Verify derived artifacts are up to date.
#   ./.github/scripts/publish.sh -h|--help  Print this help.
#
# Currently regenerates:
#   - .cursor-plugin/marketplace.json   (mirror of .claude-plugin/marketplace.json
#                                        + plugin-metadata.json)
#   - .codex-plugin/plugin.json         (Codex plugin manifest)
#   - .agents/plugins/marketplace.json  (Codex repo marketplace catalog)
#
# `.claude-plugin/marketplace.json` is hand-maintained because its
# human-facing plugin descriptions intentionally differ from the SKILL.md
# routing descriptions; ./.github/scripts/check.sh enforces that the marketplace
# listing matches skills/ on disk.
#
# Requires `uv` (https://github.com/astral-sh/uv).

set -euo pipefail

ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
cd "$ROOT_DIR"

usage() {
  sed -n 's/^# \{0,1\}//p' "${BASH_SOURCE[0]}" | sed -n '/^Usage:/,/^Requires/p'
}

case "${1:-}" in
  "")
    uv run .github/scripts/generate_cursor_marketplace.py
    uv run .github/scripts/generate_codex_plugin.py
    echo "Publish artifacts generated successfully."
    ;;
  --check)
    uv run .github/scripts/generate_cursor_marketplace.py --check
    uv run .github/scripts/generate_codex_plugin.py --check
    ;;
  -h|--help)
    usage
    ;;
  *)
    echo "Unknown option: $1" >&2
    echo "Run with --help for usage." >&2
    exit 2
    ;;
esac

SHA-256: 5b281049d887d44b4bf2342ed990825f9b8f67478f22a23151f8df683b8b1c94