# Script para publicar ImgBoost no PyPI (Windows)

Write-Host "🚀 Preparando para publicar ImgBoost no PyPI..." -ForegroundColor Green

# 1. Limpar builds anteriores
Write-Host "🧹 Limpando builds anteriores..." -ForegroundColor Yellow
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue build, dist, *.egg-info

# 2. Instalar dependências de build
Write-Host "📦 Instalando dependências de build..." -ForegroundColor Yellow
python -m pip install --upgrade pip
python -m pip install --upgrade build twine

# 3. Criar build
Write-Host "🔨 Criando build..." -ForegroundColor Yellow
python -m build

# 4. Verificar build
Write-Host "✅ Verificando build..." -ForegroundColor Yellow
twine check dist/*

Write-Host ""
Write-Host "📋 Próximos passos:" -ForegroundColor Cyan
Write-Host ""
Write-Host "1. Para publicar no Test PyPI (recomendado primeiro):" -ForegroundColor White
Write-Host "   twine upload --repository testpypi dist/*" -ForegroundColor Gray
Write-Host ""
Write-Host "2. Testar instalação do Test PyPI:" -ForegroundColor White
Write-Host "   pip install --index-url https://test.pypi.org/simple/ imgboost" -ForegroundColor Gray
Write-Host ""
Write-Host "3. Se tudo estiver OK, publicar no PyPI oficial:" -ForegroundColor White
Write-Host "   twine upload dist/*" -ForegroundColor Gray
Write-Host ""
Write-Host "⚠️  Você precisará das credenciais do PyPI (username/password ou token)" -ForegroundColor Red
