feat: add signtool to plugin repository

- Migrate signing tool from GoTunnel main project
- Self-contained, no external dependencies
- Updated CI workflow to build locally
This commit is contained in:
Flik
2025-12-29 19:05:56 +08:00
parent 6b38f133f4
commit dd52c48351
7 changed files with 261 additions and 10 deletions

View File

@@ -15,13 +15,19 @@ fi
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
REPO_ROOT="$(dirname "$SCRIPT_DIR")"
SIGNTOOL="$REPO_ROOT/signtool"
# 如果 signtool 不存在,尝试构建
if [ ! -f "$SIGNTOOL" ]; then
echo "Building signtool..."
cd "$REPO_ROOT"
go build -o signtool ./tools/signtool
fi
cd "$REPO_ROOT"
for manifest in plugins/*/manifest.json; do
if [ ! -f "$manifest" ]; then
continue
fi
[ -f "$manifest" ] || continue
dir=$(dirname "$manifest")
name=$(jq -r '.name' "$manifest")
@@ -34,7 +40,7 @@ for manifest in plugins/*/manifest.json; do
fi
echo "Signing: $name v$version"
signtool sign -key "$KEY_FILE" \
"$SIGNTOOL" sign -key "$KEY_FILE" \
-name "$name" \
-version "$version" \
"$plugin_file"