|
1 | 1 | name: windows-builds |
2 | 2 |
|
3 | | -# Trigger this workflow on any push or manual dispatch |
| 3 | +# Trigger on push to any branch and manual runs |
4 | 4 | on: |
5 | 5 | push: |
6 | | - branches: |
7 | | - - ci-dev |
8 | 6 | workflow_dispatch: |
9 | 7 |
|
10 | 8 | jobs: |
11 | | - build_windows_msvc_ninja: |
12 | | - name: Build with MSVC + Ninja |
| 9 | + build_windows_msvc: |
| 10 | + name: Build with MSVC and Ninja |
13 | 11 | runs-on: windows-2022 |
14 | 12 |
|
15 | 13 | env: |
16 | 14 | QT_VERSION: 6.4.2 |
17 | | - QT_DIR: ${{ github.workspace }}\Qt # Directory where Qt will be installed |
| 15 | + QT_DIR: ${{ github.workspace }}\Qt |
18 | 16 |
|
19 | 17 | steps: |
20 | 18 | - name: 📦 Checkout source code |
21 | 19 | uses: actions/checkout@v4 |
22 | 20 | with: |
23 | | - fetch-depth: 0 # Fetch full git history and tags |
| 21 | + fetch-depth: 0 # Fetch full history for tags if needed |
| 22 | + |
| 23 | + - name: ⚙️ Install Ninja build system |
| 24 | + run: choco install ninja --no-progress |
| 25 | + shell: powershell |
24 | 26 |
|
25 | 27 | - name: 📥 Install Qt for MSVC |
26 | 28 | uses: jurplel/install-qt-action@v3 |
27 | 29 | with: |
28 | | - version: ${{ env.QT_VERSION }} # Qt version to install |
29 | | - target: desktop # Desktop Qt build |
30 | | - host: windows # Host OS |
31 | | - arch: win64_msvc2019_64 # MSVC 2019 64-bit architecture |
32 | | - dir: ${{ env.QT_DIR }} # Install path for Qt |
33 | | - setup-python: false # Skip Python setup (optional) |
34 | | - |
35 | | - - name: ⚙️ Install Ninja build system |
36 | | - run: choco install ninja --no-progress # Install Ninja via Chocolatey |
37 | | - shell: powershell |
| 30 | + version: ${{ env.QT_VERSION }} |
| 31 | + target: desktop |
| 32 | + host: windows |
| 33 | + arch: win64_msvc2019_64 |
| 34 | + dir: ${{ env.QT_DIR }} |
| 35 | + setup-python: false |
38 | 36 |
|
39 | 37 | - name: 🛠️ Configure CMake (Ninja + MSVC) |
40 | | - # Use windows-msvc shell that auto-sets MSVC environment variables |
41 | | - shell: windows-msvc |
| 38 | + shell: pwsh |
42 | 39 | run: | |
43 | | - cmake -S . -B build ^ |
44 | | - -G Ninja ^ |
45 | | - -A x64 ^ |
46 | | - -DCMAKE_PREFIX_PATH="${{ env.QT_DIR }}\Qt\${{ env.QT_VERSION }}\msvc2019_64" ^ |
47 | | - -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}\install" ^ |
| 40 | + # Initialize MSVC environment variables for 64-bit architecture |
| 41 | + & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" amd64 |
| 42 | +
|
| 43 | + # Run cmake with Ninja generator and MSVC toolchain |
| 44 | + cmake -S . -B build -G Ninja -A x64 ` |
| 45 | + -DCMAKE_PREFIX_PATH="${{ env.QT_DIR }}\Qt\${{ env.QT_VERSION }}\msvc2019_64" ` |
| 46 | + -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}\install" ` |
48 | 47 | -DCMAKE_BUILD_TYPE=Release |
49 | 48 |
|
50 | 49 | - name: 🔨 Build with Ninja + MSVC |
51 | | - shell: windows-msvc |
52 | | - run: cmake --build build # Build the project |
| 50 | + shell: pwsh |
| 51 | + run: | |
| 52 | + # Initialize MSVC environment again for build step |
| 53 | + & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" amd64 |
| 54 | +
|
| 55 | + cmake --build build |
53 | 56 |
|
54 | 57 | - name: 📦 Install built files |
55 | | - shell: windows-msvc |
56 | | - run: cmake --install build # Install the build output |
| 58 | + shell: pwsh |
| 59 | + run: | |
| 60 | + # Initialize MSVC environment again for install step |
| 61 | + & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" amd64 |
| 62 | +
|
| 63 | + cmake --install build |
57 | 64 |
|
58 | 65 | build_windows_mingw: |
59 | | - name: Build with MinGW + Ninja |
| 66 | + name: Build with MinGW and CMake |
60 | 67 | runs-on: windows-2022 |
61 | 68 |
|
62 | 69 | env: |
63 | 70 | QT_VERSION: 6.4.2 |
64 | | - QT_DIR: ${{ github.workspace }}\Qt # Directory where Qt will be installed |
| 71 | + QT_DIR: ${{ github.workspace }}\Qt |
65 | 72 |
|
66 | 73 | steps: |
67 | 74 | - name: 📦 Checkout source code |
68 | 75 | uses: actions/checkout@v4 |
69 | 76 | with: |
70 | | - fetch-depth: 0 # Full history for tags/versions if needed |
| 77 | + fetch-depth: 0 |
71 | 78 |
|
72 | 79 | - name: ⚙️ Install Ninja and MinGW toolchain |
73 | 80 | run: | |
74 | | - choco inst |
| 81 | + choco install ninja --no-progress |
| 82 | + choco install mingw --no-progress |
| 83 | + shell: powershell |
| 84 | + |
| 85 | + - name: ➕ Add MinGW to system PATH |
| 86 | + run: echo "C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin" >> $env:GITHUB_PATH |
| 87 | + shell: powershell |
| 88 | + |
| 89 | + - name: 📥 Install Qt for MinGW |
| 90 | + uses: jurplel/install-qt-action@v3 |
| 91 | + with: |
| 92 | + version: ${{ env.QT_VERSION }} |
| 93 | + target: desktop |
| 94 | + host: windows |
| 95 | + arch: mingw_64 |
| 96 | + dir: ${{ env.QT_DIR }} |
| 97 | + setup-python: false |
| 98 | + |
| 99 | + - name: 🛠️ Configure CMake (MinGW) |
| 100 | + shell: powershell |
| 101 | + run: | |
| 102 | + cmake -S . -B build-mingw ` |
| 103 | + -DCMAKE_PREFIX_PATH="${{ env.QT_DIR }}\Qt\${{ env.QT_VERSION }}\mingw_64" ` |
| 104 | + -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\install ` |
| 105 | + -DCMAKE_BUILD_TYPE=Release ` |
| 106 | + -G Ninja |
| 107 | +
|
| 108 | + - name: 🔨 Build with CMake (MinGW) |
| 109 | + shell: powershell |
| 110 | + run: cmake --build build-mingw |
| 111 | + |
| 112 | + - name: 📦 Install built files (MinGW) |
| 113 | + shell: powershell |
| 114 | + run: cmake --install build-mingw |
0 commit comments