# Ceylon Runtime - Publish Script
# Publishes all crates in dependency order
$ErrorActionPreference = "Stop"
$runtimeDir = $PSScriptRoot
$cratesDir = Join-Path $runtimeDir "crates"
# Define crates in dependency order
$crates = @(
# @{ Name = "ceylon-core"; Path = "ceylon-core" },
# @{ Name = "ceylon-observability"; Path = "ceylon-observability" },
# @{ Name = "ceylon-llm"; Path = "ceylon-llm" },
# @{ Name = "ceylon-local"; Path = "ceylon-local" },
# @{ Name = "ceylon-memory"; Path = "ceylon-memory" },
@{ Name = "ceylon-mcp"; Path = "ceylon-mcp" }
)
Write-Host "========================================" -ForegroundColor Cyan
Write-Host " Ceylon Runtime - Publish Script" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""
# Publish sub-crates
foreach ($crate in $crates) {
$cratePath = Join-Path $cratesDir $crate.Path
Write-Host "Publishing $($crate.Name)..." -ForegroundColor Yellow
Push-Location $cratePath
try {
cargo publish
if ($LASTEXITCODE -ne 0) {
Write-Host "Failed to publish $($crate.Name)" -ForegroundColor Red
exit 1
}
Write-Host "Successfully published $($crate.Name)" -ForegroundColor Green
}
finally {
Pop-Location
}
# Wait for crates.io to index the new crate
Write-Host "Waiting 30 seconds for crates.io indexing..." -ForegroundColor Gray
Start-Sleep -Seconds 30
}
# Publish main runtime crate
Write-Host ""
Write-Host "Publishing ceylon-runtime..." -ForegroundColor Yellow
Push-Location $runtimeDir
try {
cargo publish
if ($LASTEXITCODE -ne 0) {
Write-Host "Failed to publish ceylon-runtime" -ForegroundColor Red
exit 1
}
Write-Host "Successfully published ceylon-runtime" -ForegroundColor Green
}
finally {
Pop-Location
}
Write-Host ""
Write-Host "========================================" -ForegroundColor Cyan
Write-Host " All crates published successfully!" -ForegroundColor Green
Write-Host "========================================" -ForegroundColor Cyan