Skip to content

Commit 9ae604e

Browse files
committed
fix(ci): split CMake and dotnet build steps for MSYS2 path issue
- Run CMake configure+compile in msys2 shell (needs MinGW cmake on PATH) - Run dotnet build in default shell (needs .NET SDK on PATH) - Add BuildNativeDll=false property to skip CMake when already built - Fix 'dotnet: command not found' in MSYS2 shell
1 parent fd0c01a commit 9ae604e

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,15 @@ jobs:
7070
with:
7171
dotnet-version: '10.0.x'
7272

73-
- name: Build (native + C#)
73+
- name: Build Native (CMake + MinGW)
7474
shell: msys2 {0}
75-
run: dotnet build StArray.ModManager.Windows/StArray.ModManager.Windows.csproj -c Release
75+
run: |
76+
cd StArray.ModManager.Windows/Native
77+
cmake -B build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release
78+
cmake --build build
79+
80+
- name: Build C#
81+
run: dotnet build StArray.ModManager.Windows/StArray.ModManager.Windows.csproj -c Release -p:BuildNativeDll=false
7682

7783
- name: Package
7884
run: |

‎StArray.ModManager.Windows/StArray.ModManager.Windows.csproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
</Content>
3131
</ItemGroup>
3232

33-
<Target Name="BuildNativeDll" BeforeTargets="BeforeBuild">
33+
<Target Name="BuildNativeDll" BeforeTargets="BeforeBuild" Condition="'$(BuildNativeDll)' != 'false'">
3434
<Exec Command="cmake -B &quot;$(ProjectDir)Native\build&quot; -G &quot;MinGW Makefiles&quot; -DCMAKE_BUILD_TYPE=$(Configuration)"
3535
WorkingDirectory="$(ProjectDir)Native" />
3636
<Exec Command="cmake --build &quot;$(ProjectDir)Native\build&quot;"

0 commit comments

Comments
 (0)