-
Notifications
You must be signed in to change notification settings - Fork 16
91 lines (74 loc) · 2.89 KB
/
auto-build.yml
File metadata and controls
91 lines (74 loc) · 2.89 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
name: Auto Build
on:
push:
branches: [master]
permissions:
contents: write
jobs:
build:
runs-on: windows-2022
env:
# FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
steps:
- uses: actions/checkout@v5
- uses: nuget/setup-nuget@v2
- uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x64
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
buildprops:
- 'Directory.Build.props'
- name: NuGet restore
run: nuget restore OpenHardwareMonitor.sln
- name: Build
run: |
msbuild OpenHardwareMonitor.sln /t:restore /p:RestorePackagesConfig=true /p:Configuration=Release /p:Platform="Any CPU"
msbuild OpenHardwareMonitor.sln /t:Rebuild /p:Configuration=Release /p:Platform="Any CPU" -m
msbuild OpenHardwareMonitor.sln /t:restore /p:RestorePackagesConfig=true /p:Configuration=Release /p:Platform="x64"
msbuild OpenHardwareMonitor.sln /t:Rebuild /p:Configuration=Release /p:Platform="x64" -m
msbuild OpenHardwareMonitor.sln /t:restore /p:RestorePackagesConfig=true /p:Configuration=Release /p:Platform="x86"
msbuild OpenHardwareMonitor.sln /t:Rebuild /p:Configuration=Release /p:Platform="x86" -m
- name: Publish build
uses: actions/upload-artifact@v5
with:
name: OpenHardwareMonitor
path: OpenHardwareMonitor/bin
- name: Publish Lib build
uses: actions/upload-artifact@v5
with:
name: OpenHardwareMonitorLib
path: OpenHardwareMonitorLib/bin
- name: Create zip for each exe
run: |
$source = "OpenHardwareMonitor/bin"
Get-ChildItem -Path $source -Filter *.exe | ForEach-Object {
$exePath = $_.FullName
$zipPath = Join-Path $source ($_.BaseName + ".zip")
Compress-Archive -Path $exePath -DestinationPath $zipPath -Force
}
shell: powershell
- name: Get version from exe
id: get_version
run: |
$file = Get-Item "OpenHardwareMonitor/bin/OpenHardwareMonitor.exe"
$fullVersion = $file.VersionInfo.FileVersion
$parts = $fullVersion.Split('.')
$shortVersion = "$($parts[0]).$($parts[1]).$($parts[2]).$($parts[3])"
echo "version=$shortVersion" >> $env:GITHUB_OUTPUT
shell: powershell
- name: Debug version
run: |
echo "version is set: ${{ steps.get_version.outputs.version }}"
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.get_version.outputs.version }}
name: Build ${{ steps.get_version.outputs.version }}
draft: true
files: |
OpenHardwareMonitor/bin/*.exe
OpenHardwareMonitor/bin/*.zip