build.sh
Language Shell1.5 KB42 lines
#!/usr/bin/env bash# Build the Bitrix24 desktop extension (.mcpb) from ../server.py.## Usage: ./build.sh## This bundle uses the MCPB **uv** runtime (server.type = "uv"): dependencies are# declared in pyproject.toml and resolved ON THE USER'S MACHINE by uv, which also# provisions a compatible Python. So there are NO bundled native wheels, NO# Python-version pin, and NO per-OS builds: one tiny bundle runs on macOS,# Windows, and Linux. It can be built on any OS.## Requires: Node/npm (for the `mcpb` CLI). No Python or internet-fetched wheels.set -euo pipefailHERE="$(cd "$(dirname "$0")" && pwd)"cd "$HERE"# mcpb CLIif ! command -v mcpb >/dev/null 2>&1; thenecho "Installing mcpb CLI (npm i -g @anthropic-ai/mcpb)…"npm install -g @anthropic-ai/mcpbfi# Fresh server payload from the single source of truth (../server.py).# The uv runtime launches src/server.py (see manifest server.entry_point).rm -rf srcmkdir -p srccp ../server.py src/server.py# Version stamp for the output filename (from the manifest).VER="$(python3 -c 'import json;print(json.load(open("manifest.json"))["version"])' 2>/dev/null || echo dev)"# Validate + pack. .mcpbignore keeps .venv/, caches, docs, and old artifacts out.mcpb validate manifest.jsonOUT="bitrix24-crm-${VER}.mcpb"mcpb pack . "$OUT"echoecho "Built: $HERE/$OUT"echo "One universal bundle: installs on macOS, Windows, and Linux."echo "Next: Organization settings → Connectors → Add → Custom → Desktop → upload this .mcpb,"echo " then add it to the Desktop extension allowlist."