Skip to content

Commit c126abf

Browse files
committed
Refactor Windows build presets and CI workflows
Split Windows build into 'windows-msvc' and 'windows-ninja' presets in CMakePresets.json, updating build and configuration directories accordingly. Updated CI and release GitHub Actions workflows to use the new presets and artifact paths, enabling both MSVC and Ninja builds on Windows. Cleaned up and unified preset inheritance, removed redundant or duplicate presets, and improved consistency across platforms.
1 parent 0b4c4e3 commit c126abf

File tree

3 files changed

+100
-115
lines changed

3 files changed

+100
-115
lines changed

.github/workflows/ci-windows.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ jobs:
2626
matrix:
2727
buildtype: [Release, Debug]
2828
config:
29-
- { name: "Windows", os: windows-latest, preset: "windows" }
29+
- { name: "Windows MSVC", os: windows-latest, preset: "windows-msvc" }
30+
- { name: "Windows Ninja", os: windows-latest, preset: "windows-ninja" }
3031

3132
steps:
3233
- name: Install dependencies
@@ -46,17 +47,17 @@ jobs:
4647
4748
- name: Checking that HDRView runs
4849
working-directory: ${{github.workspace}}
49-
run: ./build/${{ matrix.buildtype }}/HDRView.exe --help
50+
run: ./build/${{ matrix.config.preset }}/${{ matrix.buildtype }}/HDRView.exe --help
5051

5152
- name: Copy files for archiving
52-
working-directory: ${{github.workspace}}/build
53+
working-directory: ${{github.workspace}}/build/${{ matrix.config.preset }}
5354
run: |
5455
cmake -E copy_directory assets deploy/assets/
5556
cmake -E copy ${{ matrix.buildtype }}/HDRView.exe deploy/
5657
5758
- name: Archive build artifacts
5859
uses: actions/upload-artifact@v4
5960
with:
60-
name: build-artifacts-${{ matrix.config.os }}-${{ matrix.config.preset }}-${{ matrix.buildtype }}
61+
name: build-artifacts-${{ matrix.config.preset }}-${{ matrix.buildtype }}
6162
path: |
62-
${{github.workspace}}/build/deploy
63+
${{github.workspace}}/build/${{ matrix.config.preset }}/deploy

.github/workflows/release.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,13 @@ jobs:
173173

174174
build_windows:
175175
name: Build on Windows
176-
runs-on: windows-latest
176+
runs-on: ${{ matrix.config.os }}
177+
strategy:
178+
fail-fast: false
179+
matrix:
180+
buildtype: [Release]
181+
config:
182+
- { name: "Windows MSVC", os: windows-latest, preset: "windows-msvc" }
177183

178184
steps:
179185
- name: Install dependencies
@@ -195,40 +201,42 @@ jobs:
195201
Add-Content -Path $env:GITHUB_ENV -Value "VERSION_NO_V=$VERSION_NO_V"
196202
197203
- name: Configure CMake
198-
run: cmake --preset windows -DHDRVIEW_ENABLE_HEIC=OFF -DHDRVIEW_ENABLE_AVCI=OFF
204+
run: cmake --preset ${{ matrix.config.preset }} -DHDRVIEW_ENABLE_HEIC=OFF -DHDRVIEW_ENABLE_AVCI=OFF
199205

200206
- name: Build
201-
run: cmake --build --preset windows-release --verbose
207+
run: |
208+
$buildtype_lower = "${{ matrix.buildtype }}".ToLower()
209+
cmake --build --preset ${{ matrix.config.preset }}-$buildtype_lower --verbose
202210
203211
- name: Checking that HDRView runs
204212
working-directory: ${{github.workspace}}
205-
run: ./build/${{env.BUILD_TYPE}}/HDRView.exe --help
213+
run: ./build/${{ matrix.config.preset }}/${{ matrix.buildtype }}/HDRView.exe --help
206214

207215
- name: Copy files for archiving and release
208-
working-directory: ${{github.workspace}}/build
216+
working-directory: ${{github.workspace}}/build/${{ matrix.config.preset }}
209217
run: |
210218
cmake -E copy_directory assets deploy/assets/
211-
cmake -E copy ${{env.BUILD_TYPE}}/HDRView.exe deploy/
219+
cmake -E copy ${{ matrix.buildtype }}/HDRView.exe deploy/
212220
213221
- name: Archive build artifacts
214222
uses: actions/upload-artifact@v4
215223
with:
216-
name: build-artifacts-windows-latest
224+
name: build-artifacts-${{ matrix.config.preset }}-${{ matrix.buildtype }}
217225
path: |
218-
${{github.workspace}}/build/deploy
226+
${{github.workspace}}/build/${{ matrix.config.preset }}/deploy
219227
220228
- name: Archive Release
221229
uses: thedoctor0/zip-release@0.7.5
222230
with:
223231
type: "zip"
224232
filename: "HDRView-${{ env.VERSION_NO_V }}-windows.zip"
225-
directory: ${{github.workspace}}/build/deploy
233+
directory: ${{github.workspace}}/build/${{ matrix.config.preset }}/deploy
226234

227235
- name: Release
228236
uses: softprops/action-gh-release@v2
229237
with:
230238
files: |
231-
${{github.workspace}}/build/deploy/HDRView-${{ env.VERSION_NO_V }}-windows.zip
239+
${{github.workspace}}/build/${{ matrix.config.preset }}/deploy/HDRView-${{ env.VERSION_NO_V }}-windows.zip
232240
env:
233241
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
234242

0 commit comments

Comments
 (0)