-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (44 loc) · 2.03 KB
/
build.yaml
File metadata and controls
54 lines (44 loc) · 2.03 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
name: Build C++ and C# Projects
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: windows-2019 # Ensure we use Visual Studio 2019
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up MSBuild (VS2019)
uses: microsoft/setup-msbuild@v1
with:
vs-version: '[16.0,16.99]'
- name: Restore NuGet Packages
run: nuget restore ./GUI/ThermalGUI.sln
# ✅ Build the C++ project (force x86 for 32-bit compatibility)
- name: Build C++ Project
run: msbuild ./cpp/ThermalControlAlgorithm/ThermalControlAlgorithm.vcxproj /p:Configuration=Release /p:Platform=x86
# ✅ Ensure the target directory exists before copying the DLL
- name: Ensure Output Directory Exists
run: |
if (!(Test-Path "GUI/ThermalGUI/ThermalGUI/bin/Release")) { New-Item -ItemType Directory -Path "GUI/ThermalGUI/ThermalGUI/bin/Release" }
if (!(Test-Path "GUI/ThermalGUI/ThermalGUI/bin/Debug")) { New-Item -ItemType Directory -Path "GUI/ThermalGUI/ThermalGUI/bin/Debug" }
# ✅ Copy DLL from C++ project to C# bin folders (can skip this)
- name: Copy C++ DLL to C# Project
run: |
Copy-Item -Path "cpp/ThermalControlAlgorithm/Release/ThermalControlAlgorithm.dll" -Destination "GUI/ThermalGUI/ThermalGUI/bin/Release/" -Force
Copy-Item -Path "cpp/ThermalControlAlgorithm/Release/ThermalControlAlgorithm.dll" -Destination "GUI/ThermalGUI/ThermalGUI/bin/Debug/" -Force
# ✅ Build the C# project (.NET Framework 4.6.1, 32-bit preferred)
- name: Build C# Project
run: msbuild ./GUI/ThermalGUI.sln /p:Configuration=Release /p:Platform="Any CPU" /p:Prefer32Bit=true
# ✅ Upload executables as artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Executables
path: |
GUI/ThermalGUI/ThermalGUI/bin/Release/*.exe
GUI/ThermalGUI/ThermalGUI/bin/Release/*.dll