#!/bin/bash
# Hermes Node Protocol
# Copyright (c) 2026 Stefy (nextime) Lanza <stefy@nexlab.net>
# All rights reserved.
# 
# This software is released under the MIT License with a copyleft clause.
# See the LICENSE file for full terms.
set -e

echo "=== Building Hermes Node Agent ==="

# Build platform-specific artifacts
case "${1:-all}" in
  linux|Linux)
    echo "Building Linux artifacts..."
    bash build-linux.sh
    ;;
  windows|Windows)
    echo "Building Windows artifacts..."
    bash build-windows.sh
    ;;
  all|ALL)
    echo "Building all platform artifacts..."
    bash build-linux.sh
    bash build-windows.sh
    ;;
  *)
    echo "Usage: $0 [linux|windows|all]"
    echo ""
    echo "Builds the Node Agent distribution packages."
    echo ""
    echo "  linux    - Build Linux package"
    echo "  windows  - Build Windows package"
    echo "  all      - Build all packages (default)"
    exit 1
    ;;
esac

echo ""
echo "✅ Build complete!"
echo ""
echo "Distribution packages:"
ls -1 dist/*.tar.gz dist/*.zip 2>/dev/null || echo "  (none)"
