From 8249983b7b7440b14dd6f3e802f947463314e021 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Mon, 8 Jun 2026 20:31:56 +0200 Subject: [PATCH] Publish the Windows bundles per configuration publish.ps1 now takes a -Configuration parameter (the workflow passes the GNU-style --configuration , which pwsh binds to it) and uses it for both the -c flag and the output paths. The win-x64 framework-dependent bundle is produced for every configuration; the win-arm64 framework-dependent and win-x64 self-contained bundles stay Release-only, matching what the zip steps consume. The build workflow publishes per-configuration before zipping, and the framework-dependent binaries zip now reads straight from the publish output (...\win-x64\publish\fwdependent) for the active configuration instead of globbing the build output. Assisted-by: Claude:claude-opus-4-8:Claude Code --- .github/workflows/build-ilspy.yml | 33 ++++++++++++------------------- publish.ps1 | 32 +++++++++++++++++++++--------- 2 files changed, 36 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build-ilspy.yml b/.github/workflows/build-ilspy.yml index 049dfc571..ef10ce6af 100644 --- a/.github/workflows/build-ilspy.yml +++ b/.github/workflows/build-ilspy.yml @@ -101,41 +101,27 @@ jobs: with: paths: "test-results/${{ matrix.configuration }}/*.trx" folded: true - - - name: Verify package contents - if: matrix.configuration == 'debug' + + - name: Publish x64/arm64 framework-dependent/self-contained shell: pwsh - run: | - .\BuildTools\create-filelists.ps1 - # Only the *.filelist outputs of the script are under verification here; restore may - # legitimately rewrite OS-specific packages.lock.json files, which must not fail this step. - git diff --exit-code -- '*.filelist' + run: .\publish.ps1 -Configuration ${{ matrix.configuration }} - name: Zip ILSpy (framework-dependent) run: > 7z a -tzip $env:StagingDirectory\ILSpy_binaries.zip - .\ILSpy\bin\${{ matrix.configuration }}\net10.0\*.dll - .\ILSpy\bin\${{ matrix.configuration }}\net10.0\*.exe - .\ILSpy\bin\${{ matrix.configuration }}\net10.0\*.config - .\ILSpy\bin\${{ matrix.configuration }}\net10.0\*.json - .\ILSpy\bin\${{ matrix.configuration }}\net10.0\*\ILSpy.resources.dll - .\ILSpy\bin\${{ matrix.configuration }}\net10.0\*\ILSpy.ReadyToRun.Plugin.resources.dll - - - name: Publish x64/arm64 framework-dependent/self-contained - shell: pwsh - run: .\publish.ps1 + .\ILSpy\bin\${{ matrix.configuration }}\net10.0\win-x64\publish\fwdependent\* - name: Zip ILSpy Release (x64 self-contained) if: matrix.configuration == 'release' run: > 7z a -tzip $env:StagingDirectory\ILSpy_selfcontained_x64.zip - .\ILSpy\bin\Release\net10.0-windows\win-x64\publish\selfcontained\* + .\ILSpy\bin\Release\net10.0\win-x64\publish\selfcontained\* - name: Zip ILSpy Release (arm64 framework-dependent) if: matrix.configuration == 'release' run: > 7z a -tzip $env:StagingDirectory\ILSpy_binaries_arm64.zip - .\ILSpy\bin\Release\net10.0-windows\win-arm64\publish\fwdependent\* + .\ILSpy\bin\Release\net10.0\win-arm64\publish\fwdependent\* - name: Pack NuGets if: matrix.configuration == 'release' @@ -156,6 +142,13 @@ jobs: run: | msbuild ILSpy.VSExtensions.sln /t:Restore /p:Configuration="Release" /p:Platform="Any CPU" msbuild ILSpy.VSExtensions.sln /p:Configuration="Release" /p:Platform="Any CPU" + + - name: Verify package contents + if: matrix.configuration == 'debug' + shell: pwsh + run: | + .\BuildTools\create-filelists.ps1 + git diff --exit-code -- '*.filelist' # https://github.com/actions/upload-artifact - name: Upload VSIX (VS 2019) release build artifacts diff --git a/publish.ps1 b/publish.ps1 index 45fba14af..873cebd27 100644 --- a/publish.ps1 +++ b/publish.ps1 @@ -1,12 +1,26 @@ -$output_arm64 = "./ILSpy/bin/Release/net10.0-windows/win-arm64/publish/fwdependent" -$output_x64 = "./ILSpy/bin/Release/net10.0-windows/win-x64/publish/fwdependent" -$output_x64_selfcontained = "./ILSpy/bin/Release/net10.0-windows/win-x64/publish/selfcontained" +#!/usr/bin/env pwsh +# Publish the Windows distribution bundles. Invoked by the build workflow as: +# .\publish.ps1 --configuration +# The win-x64 framework-dependent bundle is produced for every configuration (the binaries zip). +# The win-arm64 framework-dependent and win-x64 self-contained bundles are Release-only. +param( + [ValidateSet('Debug', 'Release')] + [string]$Configuration = 'Release' +) +$ErrorActionPreference = 'Stop' -dotnet publish ./ILSpy/ILSpy.csproj -c Release --no-restore --no-self-contained -r win-arm64 -o $output_arm64 -dotnet publish ./ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj -c Release --no-restore --no-self-contained -r win-arm64 -o $output_arm64 +$base = "./ILSpy/bin/$Configuration/net10.0" -dotnet publish ./ILSpy/ILSpy.csproj -c Release --no-restore --no-self-contained -r win-x64 -o $output_x64 -dotnet publish ./ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj -c Release --no-restore --no-self-contained -r win-x64 -o $output_x64 +$output_x64 = "$base/win-x64/publish/fwdependent" +dotnet publish ./ILSpy/ILSpy.csproj -c $Configuration --no-restore --no-self-contained -r win-x64 -o $output_x64 +dotnet publish ./ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj -c $Configuration --no-restore --no-self-contained -r win-x64 -o $output_x64 -dotnet publish ./ILSpy/ILSpy.csproj -c Release --no-restore --self-contained -r win-x64 -o $output_x64_selfcontained -dotnet publish ./ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj -c Release --no-restore --self-contained -r win-x64 -o $output_x64_selfcontained \ No newline at end of file +if ($Configuration -eq 'Release') { + $output_arm64 = "$base/win-arm64/publish/fwdependent" + dotnet publish ./ILSpy/ILSpy.csproj -c $Configuration --no-restore --no-self-contained -r win-arm64 -o $output_arm64 + dotnet publish ./ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj -c $Configuration --no-restore --no-self-contained -r win-arm64 -o $output_arm64 + + $output_x64_selfcontained = "$base/win-x64/publish/selfcontained" + dotnet publish ./ILSpy/ILSpy.csproj -c $Configuration --no-restore --self-contained -r win-x64 -o $output_x64_selfcontained + dotnet publish ./ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj -c $Configuration --no-restore --self-contained -r win-x64 -o $output_x64_selfcontained +}