From 985e822ff29bf276ee650bfbfd5bcbc2958443e4 Mon Sep 17 00:00:00 2001 From: ywkj Date: Mon, 20 Apr 2026 07:26:42 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=8E=A5=E5=85=A5=20CI/CD=20skill=20?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增 .forgejo/workflows/register-skill-release.yml,推送 v* tag 时自动注册 skill。 install.sh 同步 template-skill,支持 auth-rt 自动安装。 Co-Authored-By: Claude Sonnet 4.6 --- .forgejo/workflows/register-skill-release.yml | 17 ++++++++++ .gitignore | 2 ++ install.sh | 32 +++++++++++++------ 3 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 .forgejo/workflows/register-skill-release.yml diff --git a/.forgejo/workflows/register-skill-release.yml b/.forgejo/workflows/register-skill-release.yml new file mode 100644 index 0000000..c01abb1 --- /dev/null +++ b/.forgejo/workflows/register-skill-release.yml @@ -0,0 +1,17 @@ +name: register-skill-release + +on: + push: + tags: + - 'v*' + workflow_dispatch: + +jobs: + register: + runs-on: docker + steps: + - uses: actions/checkout@v4 + + - uses: http://192.168.0.108:3030/agent-skills/shared-actions/register-skill@main + with: + client_key: ${{ secrets.CLIENT_KEY }} diff --git a/.gitignore b/.gitignore index 2ebe857..1f8e9af 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ node_modules/ dist/ .env +.env.local +*.skill snapshots_*/ *.jpg *.mp4 diff --git a/install.sh b/install.sh index c8f63cf..96b9268 100755 --- a/install.sh +++ b/install.sh @@ -1,11 +1,29 @@ #!/usr/bin/env bash set -euo pipefail +cd "$(dirname "$0")" -SKILL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# Auto-install auth-rt if not found +if ! command -v auth-rt &>/dev/null && [ ! -x "$HOME/.local/bin/auth-rt" ]; then + echo "auth-rt not found, installing..." + _FORGEJO="http://192.168.0.108:3030" + _OS="$(uname -s | tr '[:upper:]' '[:lower:]')" + _ARCH="$(uname -m)"; case "$_ARCH" in x86_64) _ARCH="amd64";; aarch64) _ARCH="arm64";; esac + _URL="$_FORGEJO/agent-skills/auth-runtime/releases/download/latest/auth-rt-${_OS}-${_ARCH}" + mkdir -p "$HOME/.local/bin" + if curl -fsSL "$_URL" -o "$HOME/.local/bin/auth-rt" 2>/dev/null; then + chmod +x "$HOME/.local/bin/auth-rt" + echo "auth-rt installed (downloaded)" + else + echo "Download failed, building from source..." + _SRC="$HOME/.local/share/auth-runtime" + if [ -d "$_SRC/.git" ]; then git -C "$_SRC" pull --ff-only + else git clone --depth 1 "$_FORGEJO/agent-skills/auth-runtime.git" "$_SRC" + fi + bash "$_SRC/install.sh" + fi +fi -echo "Installing video-product-snapshot skill..." - -# Check dependencies +# Check required system dependencies for cmd in ffmpeg ffprobe bun; do if ! command -v "$cmd" &>/dev/null; then echo "ERROR: '$cmd' not found in PATH. Please install it first." >&2 @@ -13,12 +31,8 @@ for cmd in ffmpeg ffprobe bun; do fi done -# Install npm dependencies -cd "$SKILL_DIR" bun install - -# Build dist bun run build echo "Done. Run with: bun dist/run.js [args]" -echo "Requires: ANTHROPIC_API_KEY env var for product detection." +echo "Copy .env.example to .env and fill in VISION_API_KEY."