浏览代码

Update build scripts

Ruben 1 年之前
父节点
当前提交
6f099bd07d
共有 2 个文件被更改,包括 5 次插入9 次删除
  1. 2 2
      .github/workflows/BuildWin32.yml
  2. 3 7
      Build/Build Avalonia.Win32.ps1

+ 2 - 2
.github/workflows/BuildWin32.yml

@@ -33,7 +33,7 @@ jobs:
       # Step 4 (x64): Publish x64 version
       # Step 4 (x64): Publish x64 version
       - name: Publish x64 version
       - name: Publish x64 version
         run: |
         run: |
-          pwsh -File "${{ github.workspace }}\Build\Build Avalonia.Win32.ps1" -Platform "x64"
+          pwsh -File "${{ github.workspace }}\Build\Build Avalonia.Win32.ps1" -Platform "x64" -outputPath "${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.file-version}}-win-x64"
         shell: pwsh
         shell: pwsh
 
 
       # Step 5 (x64): Upload the x64 zip file as an artifact
       # Step 5 (x64): Upload the x64 zip file as an artifact
@@ -62,7 +62,7 @@ jobs:
       # Step 4 (arm64): Publish arm64 version
       # Step 4 (arm64): Publish arm64 version
       - name: Publish arm64 version
       - name: Publish arm64 version
         run: |
         run: |
-          pwsh -File "${{ github.workspace }}\Build\Build Avalonia.Win32.ps1" -Platform "arm64"
+          pwsh -File "${{ github.workspace }}\Build\Build Avalonia.Win32.ps1" -Platform "arm64" -outputPath "${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.file-version}}-win-arm64"
         shell: pwsh
         shell: pwsh
 
 
       # Step 5 (arm64): Upload the arm64 zip file as an artifact
       # Step 5 (arm64): Upload the arm64 zip file as an artifact

+ 3 - 7
Build/Build Avalonia.Win32.ps1

@@ -1,6 +1,9 @@
 param (
 param (
     [string]$Platform = "x64"  # Default to x64 if no parameter is passed
     [string]$Platform = "x64"  # Default to x64 if no parameter is passed
 )
 )
+param (
+    [string]$outputPath = $PSScriptRoot
+)
 
 
 # Define the core project path relative to the script's location
 # Define the core project path relative to the script's location
 $coreProjectPath = Join-Path -Path $PSScriptRoot -ChildPath "..\src\PicView.Core\PicView.Core.csproj"
 $coreProjectPath = Join-Path -Path $PSScriptRoot -ChildPath "..\src\PicView.Core\PicView.Core.csproj"
@@ -30,13 +33,6 @@ $coreCsproj.Save($coreProjectPath)
 # Define the project path for the actual build target
 # Define the project path for the actual build target
 $avaloniaProjectPath = Join-Path -Path $PSScriptRoot -ChildPath "..\src\PicView.Avalonia.Win32\PicView.Avalonia.Win32.csproj"
 $avaloniaProjectPath = Join-Path -Path $PSScriptRoot -ChildPath "..\src\PicView.Avalonia.Win32\PicView.Avalonia.Win32.csproj"
 
 
-# Load the .csproj file as XML to extract the AssemblyVersion
-$avaloniaProjectFile = [xml](Get-Content $avaloniaProjectPath)
-$assemblyVersion = $avaloniaProjectFile.Project.PropertyGroup.AssemblyVersion
-
-# Define the final output path relative to the script's location
-$outputPath = Join-Path -Path $PSScriptRoot -ChildPath "PicView-v.$assemblyVersion-win-$Platform"
-
 # Run dotnet publish for the Avalonia project
 # Run dotnet publish for the Avalonia project
 dotnet publish $avaloniaProjectPath --runtime "win-$Platform" --self-contained true --configuration Release --output $outputPath /p:PublishReadyToRun=true
 dotnet publish $avaloniaProjectPath --runtime "win-$Platform" --self-contained true --configuration Release --output $outputPath /p:PublishReadyToRun=true