feat: download simulator server

This commit is contained in:
Filip131311
2026-04-14 15:09:58 +02:00
parent 448ec604f2
commit d082ea2fd2
6 changed files with 50 additions and 4 deletions
+3
View File
@@ -22,6 +22,9 @@ jobs:
registry-url: "https://npm.pkg.github.com"
scope: "@swmansion"
- name: Download signed simulator-server binary
run: bash scripts/download-simulator-server.sh
- run: npm ci
- run: npm run build -w @swmansion/argent
+3
View File
@@ -26,6 +26,9 @@ packages/*/node_modules/
*.log
1export
# Downloaded signed binary (fetched via scripts/download-simulator-server.sh)
packages/native-devtools-ios/bin/simulator-server
# MCP package generated assets (copied/bundled at build time)
packages/mcp/bin/
packages/mcp/dylibs/
+2 -1
View File
@@ -8,7 +8,8 @@
"build": "tsc --build",
"start": "npm run build -w @argent/registry && npm run dev -w @argent/tool-server",
"start:tool-server": "npm run build -w @argent/registry && npm run dev -w @argent/tool-server",
"pack:mcp": "npm run build -w @swmansion/argent && npm pack -w @swmansion/argent --pack-destination .",
"download:simulator-server": "bash scripts/download-simulator-server.sh",
"pack:mcp": "npm run download:simulator-server && npm run build -w @swmansion/argent && npm pack -w @swmansion/argent --pack-destination .",
"dev": "node scripts/dev.cjs",
"format": "prettier --write ."
},
+5 -2
View File
@@ -53,13 +53,16 @@ esbuild.buildSync({
console.log(`✓ Bundled tools server → ${path.relative(process.cwd(), OUT_FILE)}`);
// Copy simulator-server binary
// Copy simulator-server binary (downloaded via scripts/download-simulator-server.sh)
if (fs.existsSync(BIN_SRC)) {
fs.copyFileSync(BIN_SRC, BIN_DEST);
fs.chmodSync(BIN_DEST, 0o755);
console.log(`✓ Copied simulator-server binary → ${path.relative(process.cwd(), BIN_DEST)}`);
} else {
console.warn(`⚠ simulator-server binary not found at ${BIN_SRC} — skipping copy`);
throw new Error(
`simulator-server binary not found at ${BIN_SRC}.\n` +
`Run: bash scripts/download-simulator-server.sh`
);
}
// Copy ax-service binary
+36
View File
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -euo pipefail
# Downloads the signed simulator-server (argent variant) from simulator-server-releases.
#
# Usage: ./scripts/download-simulator-server.sh [release-tag]
# release-tag Optional tag to download from. If omitted, downloads the latest stable release.
#
# Requires:
# - gh CLI (no authentication needed — the repo is public)
REPO="software-mansion-labs/simulator-server-releases"
TAG="${1:-radon-main}"
ASSET_NAME="simulator-server-argent-macos"
DEST_DIR="packages/native-devtools-ios/bin"
DEST_PATH="${DEST_DIR}/simulator-server"
TAG_ARGS=()
echo "Downloading ${ASSET_NAME} from ${REPO} (tag: ${TAG})..."
mkdir -p "${DEST_DIR}"
gh release download "${TAG}" \
--repo "${REPO}" \
--pattern "${ASSET_NAME}" \
--dir "${DEST_DIR}" \
--clobber
mv "${DEST_DIR}/${ASSET_NAME}" "${DEST_PATH}"
chmod +x "${DEST_PATH}"
echo "Downloaded simulator-server to ${DEST_PATH}"
if command -v codesign &>/dev/null; then
codesign -dvv "${DEST_PATH}" 2>&1 || echo "Warning: signature verification failed"
fi