* Add ARM64 platform support to build and projects Added ARM64 as a supported platform in project files and solution configuration. Updated GitHub Actions workflows to build and publish ARM64 libraries. This enables building and distributing ARM64 binaries alongside x64 and x86. * Add ARM64 support to NuGet packaging Updated main.nuget.target to include ARM64 DLL and XML files in the NuGet package, enabling multi-platform support for win-arm64 in addition to x64 and x86. * Fix ARM64 configuration mappings in solution file Corrects the Debug and Release configuration mappings for ARM64 targets in LibreHardwareMonitor.sln, ensuring ARM64 builds use the proper platform instead of x64.
94 lines
3.4 KiB
YAML
94 lines
3.4 KiB
YAML
name: master
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: windows-2022
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: nuget/setup-nuget@v2
|
|
- uses: microsoft/setup-msbuild@v1.1
|
|
with:
|
|
msbuild-architecture: x64
|
|
|
|
- uses: dorny/paths-filter@v2
|
|
id: changes
|
|
with:
|
|
filters: |
|
|
buildprops:
|
|
- 'Directory.Build.props'
|
|
|
|
- name: Update version
|
|
if: steps.changes.outputs.buildprops == 'false'
|
|
run: |
|
|
(Get-Content Directory.Build.props) | % {
|
|
$m = [regex]::match($_, '<Version>(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?</Version>');
|
|
if(!$m.Success -or $m.Groups[4].Success -or $m.Groups[5].Success) { $_; }
|
|
else { $_ -replace $m.Value, ("<Version>{0}.{1}.{2}-pre${{ github.run_number }}</Version>" -f $m.Groups[1].Value,$m.Groups[2].Value,([convert]::ToInt32($m.Groups[3].Value)+1)); }
|
|
} | Set-Content Directory.Build.props
|
|
|
|
- name: Restore application packages
|
|
run: dotnet restore LibreHardwareMonitorLib\LibreHardwareMonitorLib.csproj
|
|
|
|
- name: Build application
|
|
run: dotnet build LibreHardwareMonitor\LibreHardwareMonitor.csproj -c Release -p:Platform=x64
|
|
|
|
- name: Publish application
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: LibreHardwareMonitor
|
|
path: |
|
|
bin/Release/net472
|
|
|
|
- name: Restore library packages
|
|
run: dotnet restore LibreHardwareMonitorLib\LibreHardwareMonitorLib.csproj
|
|
|
|
- name: Build x64 libraries
|
|
run: dotnet build LibreHardwareMonitorLib\LibreHardwareMonitorLib.csproj -c Release --no-restore -p:Platform=x64
|
|
|
|
- name: Publish x64 libraries
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: LibreHardwareMonitorLib (x64)
|
|
path: |
|
|
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 ARM64 libraries
|
|
run: dotnet build LibreHardwareMonitorLib\LibreHardwareMonitorLib.csproj -c Release --no-restore -p:Platform=ARM64
|
|
|
|
- name: Publish ARM64 libraries
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: LibreHardwareMonitorLib (ARM64)
|
|
path: |
|
|
bin/Release/ARM64
|
|
|
|
- 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
|
|
with:
|
|
name: LibreHardwareMonitorLib-nupkg
|
|
path: |
|
|
bin/Release/LibreHardwareMonitorLib.*.nupkg
|
|
|
|
- name: Publish to NuGet
|
|
run: nuget push bin\Release\LibreHardwareMonitorLib.*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}}
|