|
|
@@ -34,30 +34,13 @@ $avaloniaProjectPath = Join-Path -Path $PSScriptRoot -ChildPath "..\src\PicView.
|
|
|
$avaloniaProjectFile = [xml](Get-Content $avaloniaProjectPath)
|
|
|
$assemblyVersion = $avaloniaProjectFile.Project.PropertyGroup.AssemblyVersion
|
|
|
|
|
|
-# Define the temporary output path using the system's temp folder
|
|
|
-$tempPath = Join-Path -Path ([System.IO.Path]::GetTempPath()) -ChildPath "PicView"
|
|
|
-
|
|
|
# Define the final output path relative to the script's location
|
|
|
$outputPath = Join-Path -Path $PSScriptRoot -ChildPath "PicView-v.$assemblyVersion-win-$Platform"
|
|
|
|
|
|
-# Ensure the temp directory exists
|
|
|
-if (-Not (Test-Path $tempPath)) {
|
|
|
- New-Item -Path $tempPath -ItemType Directory | Out-Null
|
|
|
-}
|
|
|
-
|
|
|
# Run dotnet publish for the Avalonia project
|
|
|
-dotnet publish $avaloniaProjectPath --runtime "win-$Platform" --self-contained true --configuration Release --output $tempPath /p:PublishReadyToRun=true
|
|
|
+dotnet publish $avaloniaProjectPath --runtime "win-$Platform" --self-contained true --configuration Release --output $outputPath /p:PublishReadyToRun=true
|
|
|
|
|
|
|
|
|
-# Ensure the output directory exists and is empty
|
|
|
-if (Test-Path $outputPath) {
|
|
|
- Remove-Item -Path $outputPath -Recurse -Force
|
|
|
-}
|
|
|
-New-Item -Path $outputPath -ItemType Directory | Out-Null
|
|
|
-
|
|
|
-# Copy the build output to the final destination
|
|
|
-Copy-Item -Path "$tempPath\*" -Destination $outputPath -Recurse -Force
|
|
|
-
|
|
|
# Remove the PDB file
|
|
|
$pdbPath = Join-Path -Path $outputPath -ChildPath "PicView.Avalonia.pdb"
|
|
|
if (Test-Path $pdbPath) {
|
|
|
@@ -67,6 +50,4 @@ if (Test-Path $pdbPath) {
|
|
|
#Remove uninstended space
|
|
|
Rename-Item -path $outputPath -NewName $outputPath.Replace(" ","")
|
|
|
|
|
|
-# Clean up the temporary directory
|
|
|
-Start-Sleep -Seconds 2
|
|
|
-Remove-Item -Path $tempPath -Recurse -Force
|
|
|
+
|