forked from LibreHardwareMonitor/LibreHardwareMonitor
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (82 loc) · 3.52 KB
/
pull requests.yml
File metadata and controls
100 lines (82 loc) · 3.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: pull requests
on:
pull_request:
branches: [master]
jobs:
build:
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- 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}-ci${{ 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 LibreHardwareMonitor\LibreHardwareMonitor.csproj
- name: Build application
run: dotnet build LibreHardwareMonitor\LibreHardwareMonitor.csproj -c Release --no-restore -p:Platform=x64
- name: Publish net472 application
uses: actions/upload-artifact@v4
with:
name: LibreHardwareMonitor
path: |
bin/Release/net472
- name: Publish net10.0 application
uses: actions/upload-artifact@v4
with:
name: LibreHardwareMonitor (.NET 10)
path: |
bin/Release/net10.0-windows
- 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