From e162183064aa87aeaf1f82488cd6903a1a884102 Mon Sep 17 00:00:00 2001 From: Olivier Coanet Date: Fri, 3 Apr 2026 11:33:01 +0200 Subject: [PATCH 1/4] Mark library as AOT-compatible --- WmiLight.TestApp-NetCore/WmiLight.TestApp-NetCore.csproj | 1 + WmiLight/WmiLight.csproj | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/WmiLight.TestApp-NetCore/WmiLight.TestApp-NetCore.csproj b/WmiLight.TestApp-NetCore/WmiLight.TestApp-NetCore.csproj index a132002..f561085 100644 --- a/WmiLight.TestApp-NetCore/WmiLight.TestApp-NetCore.csproj +++ b/WmiLight.TestApp-NetCore/WmiLight.TestApp-NetCore.csproj @@ -6,6 +6,7 @@ WmiLight.TestApp_NetCore x64;x86;ARM64 True + true diff --git a/WmiLight/WmiLight.csproj b/WmiLight/WmiLight.csproj index c99c40c..821d5b3 100644 --- a/WmiLight/WmiLight.csproj +++ b/WmiLight/WmiLight.csproj @@ -46,6 +46,11 @@ True + + + true + true + From deaa9859bc9d83f0fe3fd574a8d17e41401e9ed2 Mon Sep 17 00:00:00 2001 From: Martin Kuschnik Date: Fri, 3 Apr 2026 17:21:23 +0200 Subject: [PATCH 2/4] Update AOT and trimming config Simplified the project file to enable IsAotCompatible, VerifyReferenceAotCompatibility, and IsTrimmable only for net8.0 or later. --- WmiLight/WmiLight.csproj | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/WmiLight/WmiLight.csproj b/WmiLight/WmiLight.csproj index 821d5b3..3c7ffe9 100644 --- a/WmiLight/WmiLight.csproj +++ b/WmiLight/WmiLight.csproj @@ -14,9 +14,12 @@ True private_key.snk - - + + + true + true + true @@ -46,11 +49,6 @@ True - - - true - true - From 82f053be4acb9b225234ce893d06ec5bc2fe411f Mon Sep 17 00:00:00 2001 From: Martin Kuschnik Date: Fri, 3 Apr 2026 17:22:57 +0200 Subject: [PATCH 3/4] Bump version to 7.1.1 --- WmiLight.Native/WmiLight.Native.rc | 8 ++++---- WmiLight/WmiLight.csproj | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/WmiLight.Native/WmiLight.Native.rc b/WmiLight.Native/WmiLight.Native.rc index c18d168..e3bcd60 100644 --- a/WmiLight.Native/WmiLight.Native.rc +++ b/WmiLight.Native/WmiLight.Native.rc @@ -43,8 +43,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 7,1,0,0 - PRODUCTVERSION 7,1,0,0 + FILEVERSION 7,1,1,0 + PRODUCTVERSION 7,1,1,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -70,12 +70,12 @@ BEGIN VALUE "FileDescription", "The native part of the WmiLight lib." #endif - VALUE "FileVersion", "7.1.0.0" + VALUE "FileVersion", "7.1.1.0" VALUE "InternalName", "WmiLight.Native" VALUE "LegalCopyright", "Copyright 2026 Martin Kuschnik" VALUE "OriginalFilename", "WmiLight.Native.dll" VALUE "ProductName", "WmiLight" - VALUE "ProductVersion", "7.1.0.0" + VALUE "ProductVersion", "7.1.1.0" END END BLOCK "VarFileInfo" diff --git a/WmiLight/WmiLight.csproj b/WmiLight/WmiLight.csproj index 3c7ffe9..f4b7d37 100644 --- a/WmiLight/WmiLight.csproj +++ b/WmiLight/WmiLight.csproj @@ -26,7 +26,7 @@ - 7.1.0 + 7.1.1 WmiLight Martin Kuschnik Martin Kuschnik @@ -45,7 +45,7 @@ <_NeedToDownloadMicrosoftNetSdkCompilersToolsetPackage>true - 7.1.0 + 7.1.1 True From d0154754a430ac9830c161ba422ab22d57d43b08 Mon Sep 17 00:00:00 2001 From: Martin Kuschnik Date: Fri, 3 Apr 2026 17:57:04 +0200 Subject: [PATCH 4/4] Fix build for external PRs by conditionally disabling assembly signing GitHub secrets are not available for pull requests from forks. This change introduces a SIGN_ASSEMBLY environment variable that disables assembly signing for PRs, allowing external contributors to successfully build the project without access to the private key. --- .github/workflows/build.yml | 7 ++++++- WmiLight/WmiLight.csproj | 5 +---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8ca5a03..b4b3a64 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,9 @@ env: # You can convert this to a build matrix if you need coverage of multiple configuration types. # https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix BUILD_CONFIGURATION: Release + # Disable assembly signing for pull requests because GitHub secrets are not available for PRs from forks. + # This allows external contributors to successfully build the project without access to the private key. + SIGN_ASSEMBLY: ${{ github.event_name != 'pull_request' }} jobs: build: @@ -32,15 +35,17 @@ jobs: run: dotnet restore - name: Extract Private Key + if: ${{ env.SIGN_ASSEMBLY == 'true' }} run: | echo "${{ secrets.PRIVATE_KEY }}" > WmiLight\private_key.base64 certutil -decode WmiLight\private_key.base64 WmiLight\private_key.snk rm WmiLight\private_key.base64 - name: Build .Net Lib - run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=AnyCPU WmiLight\WmiLight.csproj + run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=AnyCPU /p:SignAssembly=${{env.SIGN_ASSEMBLY}} WmiLight\WmiLight.csproj - name: Cleanup Private Key + if: ${{ env.SIGN_ASSEMBLY == 'true' }} run: rm WmiLight\private_key.snk - name: Build Native dynamic Lib (x64) diff --git a/WmiLight/WmiLight.csproj b/WmiLight/WmiLight.csproj index f4b7d37..061b1b9 100644 --- a/WmiLight/WmiLight.csproj +++ b/WmiLight/WmiLight.csproj @@ -10,11 +10,8 @@ bin\Release\WmiLight.xml + private_key.snk - - True - private_key.snk - true