Initial commit: plugin repository structure
Some checks failed
Sign Plugins / sign (push) Failing after 32s
Some checks failed
Sign Plugins / sign (push) Failing after 32s
- GitHub Actions workflows for signing and validation - Example file-manager plugin - Scripts for batch signing
This commit is contained in:
43
scripts/sign-all.sh
Executable file
43
scripts/sign-all.sh
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
KEY_FILE="$1"
|
||||
|
||||
if [ -z "$KEY_FILE" ]; then
|
||||
echo "Usage: $0 <private-key-file>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "$KEY_FILE" ]; then
|
||||
echo "Error: Key file not found: $KEY_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
REPO_ROOT="$(dirname "$SCRIPT_DIR")"
|
||||
|
||||
cd "$REPO_ROOT"
|
||||
|
||||
for manifest in plugins/*/manifest.json; do
|
||||
if [ ! -f "$manifest" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
dir=$(dirname "$manifest")
|
||||
name=$(jq -r '.name' "$manifest")
|
||||
version=$(jq -r '.version' "$manifest")
|
||||
plugin_file="$dir/plugin.js"
|
||||
|
||||
if [ ! -f "$plugin_file" ]; then
|
||||
echo "Warning: $plugin_file not found, skipping"
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "Signing: $name v$version"
|
||||
signtool sign -key "$KEY_FILE" \
|
||||
-name "$name" \
|
||||
-version "$version" \
|
||||
"$plugin_file"
|
||||
done
|
||||
|
||||
echo "Done!"
|
||||
29
scripts/validate.sh
Executable file
29
scripts/validate.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
ERRORS=0
|
||||
|
||||
for manifest in plugins/*/manifest.json; do
|
||||
[ -f "$manifest" ] || continue
|
||||
dir=$(dirname "$manifest")
|
||||
name=$(basename "$dir")
|
||||
|
||||
echo "Validating: $name"
|
||||
|
||||
# 检查必需字段
|
||||
for field in name version description; do
|
||||
val=$(jq -r ".$field" "$manifest")
|
||||
if [ "$val" = "null" ] || [ -z "$val" ]; then
|
||||
echo " Error: missing $field"
|
||||
ERRORS=$((ERRORS + 1))
|
||||
fi
|
||||
done
|
||||
|
||||
# 检查 plugin.js 存在
|
||||
if [ ! -f "$dir/plugin.js" ]; then
|
||||
echo " Error: plugin.js not found"
|
||||
ERRORS=$((ERRORS + 1))
|
||||
fi
|
||||
done
|
||||
|
||||
exit $ERRORS
|
||||
Reference in New Issue
Block a user