You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.4 KiB
34 lines
1.4 KiB
# Avalonia App Linux Publish Script
|
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
|
|
Write-Host "Publishing Avalonia app to Linux..." -ForegroundColor Green
|
|
Write-Host ""
|
|
|
|
# Clean previous publish files
|
|
if (Test-Path "publish\linux-x64") {
|
|
Write-Host "Cleaning old publish files..." -ForegroundColor Yellow
|
|
Remove-Item "publish\linux-x64" -Recurse -Force
|
|
}
|
|
|
|
# Publish to Linux x64
|
|
Write-Host "Publishing to Linux x64 platform..." -ForegroundColor Cyan
|
|
$result = dotnet publish -c Release -r linux-x64 --self-contained true -o "publish\linux-x64"
|
|
|
|
if ($LASTEXITCODE -eq 0) {
|
|
Write-Host ""
|
|
Write-Host "[SUCCESS] Publish completed!" -ForegroundColor Green
|
|
Write-Host "[INFO] Publish location: publish\linux-x64\" -ForegroundColor Blue
|
|
Write-Host ""
|
|
Write-Host "[FILES] Published files:" -ForegroundColor Yellow
|
|
Get-ChildItem "publish\linux-x64" | Select-Object Name, Length | Format-Table -AutoSize
|
|
Write-Host ""
|
|
Write-Host "[NEXT STEPS]" -ForegroundColor Magenta
|
|
Write-Host "1. Copy publish\linux-x64\ folder to WSL Ubuntu" -ForegroundColor White
|
|
Write-Host "2. In Ubuntu run: chmod +x MyAvaloniaApp" -ForegroundColor White
|
|
Write-Host "3. In Ubuntu run: ./MyAvaloniaApp" -ForegroundColor White
|
|
Write-Host ""
|
|
} else {
|
|
Write-Host "[ERROR] Publish failed! Please check error messages." -ForegroundColor Red
|
|
}
|
|
|
|
Read-Host "Press any key to continue..."
|
|
|