Skip to content

Commit d1367c9

Browse files
Updated the MinGW build
1 parent 31402ee commit d1367c9

File tree

1 file changed

+57
-47
lines changed

1 file changed

+57
-47
lines changed

.github/workflows/windows-cmake.yml

Lines changed: 57 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -53,50 +53,60 @@ jobs:
5353
run: cmake --install build
5454
shell: powershell
5555

56-
build_windows_mingw:
57-
name: Build with Qt's MinGW and CMake (no Ninja)
58-
runs-on: windows-2022
59-
60-
env:
61-
QT_VERSION: 6.8.2
62-
QT_DIR: ${{ github.workspace }}\Qt
63-
64-
steps:
65-
- name: 📦 Checkout source code
66-
uses: actions/checkout@v4
67-
with:
68-
fetch-depth: 0
69-
70-
- name: 📥 Install Qt for MinGW (with bundled toolchain)
71-
uses: jurplel/install-qt-action@v4
72-
with:
73-
aqtversion: '==3.1.19'
74-
version: ${{ env.QT_VERSION }}
75-
target: desktop
76-
host: windows
77-
arch: win64_mingw
78-
dir: ${{ env.QT_DIR }}
79-
setup-python: false
80-
81-
- name: ➕ Add Qt-bundled MinGW to PATH
82-
shell: powershell
83-
run: |
84-
$mingwPath = Get-ChildItem "${{ env.QT_DIR }}\Tools" | Where-Object { $_.Name -like "mingw*" } | Select-Object -First 1
85-
echo "${{ env.QT_DIR }}\Tools\$($mingwPath.Name)\bin" >> $env:GITHUB_PATH
86-
87-
- name: 🛠️ Configure CMake (MinGW)
88-
shell: powershell
89-
run: |
90-
cmake -S . -B build-mingw `
91-
-DCMAKE_PREFIX_PATH="${{ env.QT_DIR }}\Qt\${{ env.QT_VERSION }}\mingw_64" `
92-
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\install `
93-
-DCMAKE_BUILD_TYPE=Release `
94-
-G "MinGW Makefiles"
95-
96-
- name: 🔨 Build with CMake (MinGW)
97-
shell: powershell
98-
run: cmake --build build-mingw -- -j2
99-
100-
- name: 📦 Install built files (MinGW)
101-
shell: powershell
102-
run: cmake --install build-mingw
56+
build_windows_mingw:
57+
name: Build with Qt's MinGW and CMake (no Ninja)
58+
runs-on: windows-2022
59+
60+
env:
61+
QT_VERSION: 6.8.2
62+
QT_DIR: ${{ github.workspace }}\Qt
63+
QT_CACHE_KEY: qt-${{ runner.os }}-${{ env.QT_VERSION }}-mingw
64+
65+
steps:
66+
- name: 📦 Checkout source code
67+
uses: actions/checkout@v4
68+
with:
69+
fetch-depth: 0
70+
71+
- name: 💾 Restore Qt cache
72+
id: qt-cache
73+
uses: actions/cache@v4
74+
with:
75+
path: ${{ env.QT_DIR }}
76+
key: ${{ env.QT_CACHE_KEY }}
77+
78+
- name: 📥 Install Qt + MinGW (if not cached)
79+
if: steps.qt-cache.outputs.cache-hit != 'true'
80+
uses: jurplel/install-qt-action@v4
81+
with:
82+
aqtversion: '==3.1.19'
83+
version: ${{ env.QT_VERSION }}
84+
target: desktop
85+
host: windows
86+
arch: win64_mingw
87+
dir: ${{ env.QT_DIR }}
88+
tools: 'tools_mingw'
89+
setup-python: false
90+
91+
- name: ➕ Add Qt-bundled MinGW to PATH
92+
shell: powershell
93+
run: |
94+
$mingwPath = Get-ChildItem "${{ env.QT_DIR }}\Tools" | Where-Object { $_.Name -like "mingw*" } | Select-Object -First 1
95+
echo "${{ env.QT_DIR }}\Tools\$($mingwPath.Name)\bin" >> $env:GITHUB_PATH
96+
97+
- name: 🛠️ Configure CMake (MinGW)
98+
shell: powershell
99+
run: |
100+
cmake -S . -B build-mingw `
101+
-DCMAKE_PREFIX_PATH="${{ env.QT_DIR }}\Qt\${{ env.QT_VERSION }}\mingw_64" `
102+
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\install `
103+
-DCMAKE_BUILD_TYPE=Release `
104+
-G "MinGW Makefiles"
105+
106+
- name: 🔨 Build with CMake (MinGW)
107+
shell: powershell
108+
run: cmake --build build-mingw -- -j2
109+
110+
- name: 📦 Install built files (MinGW)
111+
shell: powershell
112+
run: cmake --install build-mingw

0 commit comments

Comments
 (0)