forked from LibreHardwareMonitor/LibreHardwareMonitor
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (63 loc) · 2.35 KB
/
master.yml
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
name: master
on:
push:
branches: [master]
jobs:
build:
runs-on: windows-2022
steps:
- uses: actions/checkout@v2
- uses: nuget/setup-nuget@v1
- uses: microsoft/[email protected]
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: NuGet restore
run: nuget restore LibreHardwareMonitor.sln
- name: Build
run: msbuild LibreHardwareMonitor.sln -p:Configuration=Release -m
- name: Publish net472
uses: actions/upload-artifact@v2
with:
name: LibreHardwareMonitor-net472
path: |
bin/Release/net472
- name: Publish netstandard20
uses: actions/upload-artifact@v2
with:
name: LibreHardwareMonitorLib-netstandard20
path: |
bin/Release/netstandard2.0
- name: Publish net60
uses: actions/upload-artifact@v2
with:
name: LibreHardwareMonitorLib-net60
path: |
bin/Release/net6.0
- name: Publish net70
uses: actions/upload-artifact@v2
with:
name: LibreHardwareMonitorLib-net70
path: |
bin/Release/net7.0
- name: Publish nupkg
uses: actions/upload-artifact@v2
with:
name: LibreHardwareMonitorLib-nupkg
path: |
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}}