- Created scripts/compile-all.sh for all 5 platforms - Successfully compiled binaries for: - Linux x64 (345MB) - Linux ARM64 (340MB) - macOS x64 (337MB) - macOS ARM64 (334MB) - Windows x64 (345MB) - Added --no-check flag to bypass npm:net-snmp type issues - Updated .gitignore for Deno artifacts - Tested compiled binary - working successfully Note: Binaries embed npm:net-snmp with native bindings Warning from Deno about cross-platform node_modules compatibility noted
64 lines
1.8 KiB
Bash
Executable File
64 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
# Get version from deno.json
|
|
VERSION=$(cat deno.json | grep -o '"version": *"[^"]*"' | cut -d'"' -f4)
|
|
BINARY_DIR="dist/binaries"
|
|
|
|
echo "================================================"
|
|
echo " NUPST Compilation Script"
|
|
echo " Version: ${VERSION}"
|
|
echo "================================================"
|
|
echo ""
|
|
echo "Compiling for all supported platforms..."
|
|
echo ""
|
|
|
|
# Create binary directory
|
|
mkdir -p "$BINARY_DIR"
|
|
|
|
# Linux x86_64
|
|
echo "→ Compiling for Linux x86_64..."
|
|
deno compile --allow-all --no-check --output "$BINARY_DIR/nupst-linux-x64" \
|
|
--target x86_64-unknown-linux-gnu mod.ts
|
|
echo " ✓ Linux x86_64 complete"
|
|
echo ""
|
|
|
|
# Linux ARM64
|
|
echo "→ Compiling for Linux ARM64..."
|
|
deno compile --allow-all --no-check --output "$BINARY_DIR/nupst-linux-arm64" \
|
|
--target aarch64-unknown-linux-gnu mod.ts
|
|
echo " ✓ Linux ARM64 complete"
|
|
echo ""
|
|
|
|
# macOS x86_64
|
|
echo "→ Compiling for macOS x86_64..."
|
|
deno compile --allow-all --no-check --output "$BINARY_DIR/nupst-macos-x64" \
|
|
--target x86_64-apple-darwin mod.ts
|
|
echo " ✓ macOS x86_64 complete"
|
|
echo ""
|
|
|
|
# macOS ARM64
|
|
echo "→ Compiling for macOS ARM64..."
|
|
deno compile --allow-all --no-check --output "$BINARY_DIR/nupst-macos-arm64" \
|
|
--target aarch64-apple-darwin mod.ts
|
|
echo " ✓ macOS ARM64 complete"
|
|
echo ""
|
|
|
|
# Windows x86_64
|
|
echo "→ Compiling for Windows x86_64..."
|
|
deno compile --allow-all --no-check --output "$BINARY_DIR/nupst-windows-x64.exe" \
|
|
--target x86_64-pc-windows-msvc mod.ts
|
|
echo " ✓ Windows x86_64 complete"
|
|
echo ""
|
|
|
|
echo "================================================"
|
|
echo " Compilation Summary"
|
|
echo "================================================"
|
|
echo ""
|
|
ls -lh "$BINARY_DIR/" | tail -n +2
|
|
echo ""
|
|
echo "✓ All binaries compiled successfully!"
|
|
echo ""
|
|
echo "Binary location: $BINARY_DIR/"
|
|
echo ""
|