#!/bin/bash
# Copyright (C) 2026 Stefy Lanza <stefy@nexlab.net>
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyleft: this program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 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)"
