Ship unsigned MCPB packages built from the ArtCraft Launcher CLIs, with install docs and skill 0.2.0 updates.
47 lines
1.2 KiB
Bash
47 lines
1.2 KiB
Bash
#!/usr/bin/env bash
|
|
# Builds dist/<name>-v<version>.mcpb from skills/<name>/extension/
|
|
# Steps: fetch-cli, mcpb validate, mcpb pack. Unsigned (no cert).
|
|
# Usage: scripts/package-mcpb.sh <skill-name> [cli-path]
|
|
set -euo pipefail
|
|
source "$(dirname "$0")/lib.sh"
|
|
|
|
name="${1:-}"
|
|
cli_path="${2:-}"
|
|
if [[ -z "$name" ]]; then
|
|
echo "Aufruf: scripts/package-mcpb.sh <skill-name> [cli-path]" >&2
|
|
exit 1
|
|
fi
|
|
|
|
dir="$SKILLS_DIR/$name"
|
|
ext="$dir/extension"
|
|
[[ -f "$ext/manifest.json" ]] || { echo "skills/$name/extension/ fehlt." >&2; exit 1; }
|
|
|
|
ver="$(skill_version "$dir")"
|
|
[[ -n "$ver" ]] || { echo "CHANGELOG von $name hat keine Version." >&2; exit 1; }
|
|
|
|
if [[ -n "$cli_path" ]]; then
|
|
bash "$(dirname "$0")/fetch-cli.sh" "$name" "$cli_path"
|
|
else
|
|
bash "$(dirname "$0")/fetch-cli.sh" "$name"
|
|
fi
|
|
|
|
man_ver="$(python3 -c 'import json,sys; print(json.load(open(sys.argv[1],encoding="utf-8"))["version"])' "$ext/manifest.json")"
|
|
if [[ "$man_ver" != "$ver" ]]; then
|
|
echo "manifest.json version '$man_ver' != CHANGELOG '$ver'." >&2
|
|
exit 1
|
|
fi
|
|
|
|
mkdir -p "$DIST_DIR"
|
|
out="$DIST_DIR/$name-v$ver.mcpb"
|
|
rm -f "$out"
|
|
|
|
(
|
|
cd "$ext"
|
|
npx --yes @anthropic-ai/mcpb validate .
|
|
npx --yes @anthropic-ai/mcpb pack . "$out"
|
|
)
|
|
|
|
echo
|
|
echo "dist/$name-v$ver.mcpb"
|
|
unzip -l "$out"
|