#!/bin/bash
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"

cd "$PROJECT_ROOT"

echo "========================================"
echo "FetchML Release Preparation"
echo "========================================"
echo ""

# Run all cleanup phases
"${SCRIPT_DIR}/cleanup-docker.sh"
"${SCRIPT_DIR}/cleanup-podman.sh"
"${SCRIPT_DIR}/cleanup-secrets.sh"
"${SCRIPT_DIR}/sanitize-configs.sh"
"${SCRIPT_DIR}/cleanup-testdata.sh"
"${SCRIPT_DIR}/cleanup-logs.sh"
"${SCRIPT_DIR}/cleanup-state.sh"

# Run verification
echo ""
"${SCRIPT_DIR}/verify-release.sh"

echo ""
echo "========================================"
echo "Release preparation complete!"
echo "========================================"
