diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 544cbfc..fb66abb 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -30,39 +30,47 @@ jobs: else { $_ -replace $m.Value, ("{0}.{1}.{2}-pre${{ github.run_number }}" -f $m.Groups[1].Value,$m.Groups[2].Value,([convert]::ToInt32($m.Groups[3].Value)+1)); } } | Set-Content Directory.Build.props - - name: NuGet restore - run: dotnet restore LibreHardwareMonitor.sln + - name: Restore application packages + run: dotnet restore LibreHardwareMonitorLib\LibreHardwareMonitorLib.csproj - - name: Build - run: dotnet build LibreHardwareMonitor.sln --configuration Release --no-restore + - name: Build application + run: dotnet build LibreHardwareMonitor\LibreHardwareMonitor.csproj -c Release -p:Platform=x64 - - name: Publish net472 + - name: Publish application uses: actions/upload-artifact@v4 with: - name: LibreHardwareMonitor-net472 + name: LibreHardwareMonitor path: | bin/Release/net472 - - name: Publish netstandard20 - uses: actions/upload-artifact@v4 - with: - name: LibreHardwareMonitorLib-netstandard20 - path: | - bin/Release/netstandard2.0 + - name: Restore library packages + run: dotnet restore LibreHardwareMonitorLib\LibreHardwareMonitorLib.csproj - - name: Publish net80 - uses: actions/upload-artifact@v4 - with: - name: LibreHardwareMonitorLib-net80 - path: | - bin/Release/net8.0 + - name: Build x64 libraries + run: dotnet build LibreHardwareMonitorLib\LibreHardwareMonitorLib.csproj -c Release --no-restore -p:Platform=x64 - - name: Publish net90 + - name: Publish x64 libraries uses: actions/upload-artifact@v4 with: - name: LibreHardwareMonitorLib-net90 + name: LibreHardwareMonitorLib (x64) path: | - bin/Release/net9.0 + bin/Release/x64 + + - name: Build x86 libraries + run: dotnet build LibreHardwareMonitorLib\LibreHardwareMonitorLib.csproj -c Release --no-restore -p:Platform=x86 + + - name: Publish x86 libraries + uses: actions/upload-artifact@v4 + with: + name: LibreHardwareMonitorLib (x86) + path: | + bin/Release/x86 + + - name: Build reference libraries + run: dotnet build LibreHardwareMonitorLib\LibreHardwareMonitorLib.csproj -c Release --no-restore -p:BuildOnlyRefs=true + + - name: Pack main nupkg + run: dotnet pack LibreHardwareMonitorLib\LibreHardwareMonitorLib.csproj -c Release -p:PackMainNuget=true --no-build --output bin\Release - name: Publish nupkg uses: actions/upload-artifact@v4 @@ -72,4 +80,4 @@ jobs: bin/Release/LibreHardwareMonitorLib.*.nupkg - name: Publish to NuGet - run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}} + run: nuget push bin/Release/LibreHardwareMonitorLib.*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}} diff --git a/.github/workflows/pull requests.yml b/.github/workflows/pull requests.yml index 3f57016..a87635c 100644 --- a/.github/workflows/pull requests.yml +++ b/.github/workflows/pull requests.yml @@ -30,39 +30,47 @@ jobs: else { $_ -replace $m.Value, ("{0}.{1}.{2}-ci${{ github.run_number }}" -f $m.Groups[1].Value,$m.Groups[2].Value,([convert]::ToInt32($m.Groups[3].Value)+1)); } } | Set-Content Directory.Build.props - - name: Restore packages - run: dotnet restore LibreHardwareMonitor.sln + - name: Restore application packages + run: dotnet restore LibreHardwareMonitorLib\LibreHardwareMonitorLib.csproj - - name: Build - run: dotnet build LibreHardwareMonitor.sln --configuration Release --no-restore + - name: Build application + run: dotnet build LibreHardwareMonitor\LibreHardwareMonitor.csproj -c Release -p:Platform=x64 - - name: Publish net472 + - name: Publish application uses: actions/upload-artifact@v4 with: - name: LibreHardwareMonitor-net472 + name: LibreHardwareMonitor path: | bin/Release/net472 - - name: Publish netstandard20 - uses: actions/upload-artifact@v4 - with: - name: LibreHardwareMonitorLib-netstandard20 - path: | - bin/Release/netstandard2.0 + - name: Restore library packages + run: dotnet restore LibreHardwareMonitorLib\LibreHardwareMonitorLib.csproj - - name: Publish net80 - uses: actions/upload-artifact@v4 - with: - name: LibreHardwareMonitorLib-net80 - path: | - bin/Release/net8.0 + - name: Build x64 libraries + run: dotnet build LibreHardwareMonitorLib\LibreHardwareMonitorLib.csproj -c Release --no-restore -p:Platform=x64 - - name: Publish net90 + - name: Publish x64 libraries uses: actions/upload-artifact@v4 with: - name: LibreHardwareMonitorLib-net90 + name: LibreHardwareMonitorLib (x64) path: | - bin/Release/net9.0 + bin/Release/x64 + + - name: Build x86 libraries + run: dotnet build LibreHardwareMonitorLib\LibreHardwareMonitorLib.csproj -c Release --no-restore -p:Platform=x86 + + - name: Publish x86 libraries + uses: actions/upload-artifact@v4 + with: + name: LibreHardwareMonitorLib (x86) + path: | + bin/Release/x86 + + - name: Build reference libraries + run: dotnet build LibreHardwareMonitorLib\LibreHardwareMonitorLib.csproj -c Release --no-restore -p:BuildOnlyRefs=true + + - name: Pack main nupkg + run: dotnet pack LibreHardwareMonitorLib\LibreHardwareMonitorLib.csproj -c Release -p:PackMainNuget=true --no-build --output bin\Release - name: Publish nupkg uses: actions/upload-artifact@v4 diff --git a/LibreHardwareMonitorLib/LibreHardwareMonitorLib.csproj b/LibreHardwareMonitorLib/LibreHardwareMonitorLib.csproj index 1fbfdec..cc9428f 100644 --- a/LibreHardwareMonitorLib/LibreHardwareMonitorLib.csproj +++ b/LibreHardwareMonitorLib/LibreHardwareMonitorLib.csproj @@ -19,12 +19,19 @@ packageicon.png true x64;x86 + win-x64;win-x86 + $(NoWarn);CA1416 + + + AnyCPU + true + false - ..\bin\Debug\ + ..\bin\Debug\$(Platform)\ - ..\bin\Release\ + ..\bin\Release\$(Platform)\ true @@ -63,4 +70,5 @@ True + diff --git a/LibreHardwareMonitorLib/main.nuget.target b/LibreHardwareMonitorLib/main.nuget.target new file mode 100644 index 0000000..a6619ed --- /dev/null +++ b/LibreHardwareMonitorLib/main.nuget.target @@ -0,0 +1,27 @@ + + + + false + $(NoWarn);NU5131 + + + + runtimes\win-x64\lib\ + + + runtimes\win-x64\lib\ + + + runtimes\win-x86\lib\ + + + runtimes\win-x86\lib\ + + + ref\ + + + ref\ + + + \ No newline at end of file