|
6 | 6 |
|
7 | 7 | env:
|
8 | 8 | BUILD_TYPE: RelWithDebInfo
|
| 9 | + VCPKG_DEPS_REVISION: 14f130a69c29d10ecd31305db45979cf12f0c162 |
9 | 10 |
|
10 | 11 | jobs:
|
11 | 12 | Ubuntu:
|
@@ -89,3 +90,144 @@ jobs:
|
89 | 90 | run: |
|
90 | 91 | cd build
|
91 | 92 | make -j $(sysctl -n hw.logicalcpu) package
|
| 93 | +
|
| 94 | + Windows: |
| 95 | + strategy: |
| 96 | + fail-fast: true |
| 97 | + matrix: |
| 98 | + image: |
| 99 | + - windows-2019 |
| 100 | + - windows-2022 |
| 101 | + |
| 102 | + name: ${{ matrix.image }} |
| 103 | + |
| 104 | + runs-on: ${{ matrix.image }} |
| 105 | + |
| 106 | + steps: |
| 107 | + - uses: actions/checkout@v2 |
| 108 | + |
| 109 | + - name: Create directories for dependencies |
| 110 | + run: | |
| 111 | + mkdir -p ${{ github.workspace }}/deps |
| 112 | + mkdir -p ${{ github.workspace }}/deps/Qt |
| 113 | +
|
| 114 | + - name: Download prebuilt vcpkg packages |
| 115 | + working-directory: ${{ github.workspace }}/deps |
| 116 | + run: > |
| 117 | + curl --fail --retry 3 -L |
| 118 | + -o vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}.7z |
| 119 | + https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}.7z |
| 120 | +
|
| 121 | + - name: Extract archived prebuilt vcpkg packages |
| 122 | + working-directory: ${{ github.workspace }}/deps |
| 123 | + run: 7z x -y -ovcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }} vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}.7z |
| 124 | + |
| 125 | + - name: Cache Qt |
| 126 | + id: qt-cache |
| 127 | + uses: actions/cache@v4 |
| 128 | + with: |
| 129 | + path: ${{ github.workspace }}/deps/Qt/6.6.3/msvc2019_64 |
| 130 | + key: qt-cache-6.6.3-msvc2019_64-v1 |
| 131 | + |
| 132 | + - name: Download aqt |
| 133 | + if: steps.qt-cache.outputs.cache-hit != 'true' |
| 134 | + working-directory: ${{ github.workspace }}/deps/Qt |
| 135 | + run: > |
| 136 | + curl --fail --retry 3 -L |
| 137 | + -o aqt_x64.exe |
| 138 | + https://github.com/miurahr/aqtinstall/releases/download/v3.1.15/aqt_x64.exe |
| 139 | +
|
| 140 | + - name: Install Qt with aqt |
| 141 | + if: steps.qt-cache.outputs.cache-hit != 'true' |
| 142 | + working-directory: ${{ github.workspace }}/deps/Qt |
| 143 | + run: .\aqt_x64.exe install-qt windows desktop 6.6.3 win64_msvc2019_64 |
| 144 | + |
| 145 | + - uses: ilammy/msvc-dev-cmd@v1 |
| 146 | + |
| 147 | + - uses: seanmiddleditch/gha-setup-ninja@master |
| 148 | + |
| 149 | + - name: Configure OpenMW |
| 150 | + run: > |
| 151 | + cmake |
| 152 | + -S . |
| 153 | + -B ${{ github.workspace }}/build |
| 154 | + -G Ninja |
| 155 | + -D CMAKE_BUILD_TYPE=RelWithDebInfo |
| 156 | + -D CMAKE_TOOLCHAIN_FILE='${{ github.workspace }}/deps/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}/scripts/buildsystems/vcpkg.cmake' |
| 157 | + -D CMAKE_PREFIX_PATH='${{ github.workspace }}/deps/Qt/6.6.3/msvc2019_64' |
| 158 | + -D LuaJit_INCLUDE_DIR='${{ github.workspace }}/deps/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}/installed/x64-windows/include/luajit' |
| 159 | + -D LuaJit_LIBRARY='${{ github.workspace }}/deps/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}/installed/x64-windows/lib/lua51.lib' |
| 160 | + -D BUILD_BENCHMARKS=ON |
| 161 | + -D BUILD_COMPONENTS_TESTS=ON |
| 162 | + -D BUILD_OPENMW_TESTS=ON |
| 163 | + -D BUILD_OPENCS_TESTS=ON |
| 164 | + -D OPENMW_USE_SYSTEM_SQLITE3=OFF |
| 165 | + -D OPENMW_USE_SYSTEM_YAML_CPP=OFF |
| 166 | + -D OPENMW_LTO_BUILD=ON |
| 167 | +
|
| 168 | + - name: Build OpenMW |
| 169 | + working-directory: ${{ github.workspace }} |
| 170 | + run: cmake --build ${{ github.workspace }}/build |
| 171 | + |
| 172 | + - name: Install OpenMW |
| 173 | + working-directory: ${{ github.workspace }} |
| 174 | + run: cmake --install ${{ github.workspace }}/build --prefix ${{ github.workspace }}/install |
| 175 | + |
| 176 | + - name: Copy missing DLLs |
| 177 | + run: | |
| 178 | + cp ${{ github.workspace }}/deps/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}/installed/x64-windows/bin/Release/MyGUIEngine.dll ${{ github.workspace }}/install |
| 179 | + cp -Filter *.dll -Recurse ${{ github.workspace }}/deps/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}/installed/x64-windows/bin/osgPlugins-3.6.5 ${{ github.workspace }}/install |
| 180 | + cp ${{ github.workspace }}/deps/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}/installed/x64-windows/bin/*.dll ${{ github.workspace }}/install |
| 181 | +
|
| 182 | + - name: Copy Qt DLLs |
| 183 | + working-directory: ${{ github.workspace }}/deps/Qt/6.6.3/msvc2019_64 |
| 184 | + run: | |
| 185 | + cp bin/Qt6Core.dll ${{ github.workspace }}/install |
| 186 | + cp bin/Qt6Gui.dll ${{ github.workspace }}/install |
| 187 | + cp bin/Qt6Network.dll ${{ github.workspace }}/install |
| 188 | + cp bin/Qt6OpenGL.dll ${{ github.workspace }}/install |
| 189 | + cp bin/Qt6OpenGLWidgets.dll ${{ github.workspace }}/install |
| 190 | + cp bin/Qt6Widgets.dll ${{ github.workspace }}/install |
| 191 | + cp bin/Qt6Svg.dll ${{ github.workspace }}/install |
| 192 | + mkdir ${{ github.workspace }}/install/styles |
| 193 | + cp plugins/styles/qwindowsvistastyle.dll ${{ github.workspace }}/install/styles |
| 194 | + mkdir ${{ github.workspace }}/install/platforms |
| 195 | + cp plugins/platforms/qwindows.dll ${{ github.workspace }}/install/platforms |
| 196 | + mkdir ${{ github.workspace }}/install/imageformats |
| 197 | + cp plugins/imageformats/qsvg.dll ${{ github.workspace }}/install/imageformats |
| 198 | + mkdir ${{ github.workspace }}/install/iconengines |
| 199 | + cp plugins/iconengines/qsvgicon.dll ${{ github.workspace }}/install/iconengines |
| 200 | +
|
| 201 | + - name: Move pdb files |
| 202 | + run: | |
| 203 | + robocopy install pdb *.pdb /MOVE |
| 204 | + if ($lastexitcode -lt 8) { |
| 205 | + $global:LASTEXITCODE = $null |
| 206 | + } |
| 207 | +
|
| 208 | + - name: Remove extra pdb files |
| 209 | + shell: bash |
| 210 | + run: | |
| 211 | + rm -rf install/bin |
| 212 | + rm -rf install/_deps |
| 213 | +
|
| 214 | + - name: Generate CI-ID.txt |
| 215 | + shell: bash |
| 216 | + env: |
| 217 | + GH_TOKEN: ${{ github.token }} |
| 218 | + run: | |
| 219 | + job_url=$(gh run --repo ${{ github.repository }} view ${{ github.run_id }} --json jobs --jq '.jobs[] | select(.name == "${{ matrix.image }}") | .url') |
| 220 | + printf "Ref ${{ github.ref }}\nJob ${job_url}\nCommit ${{ github.sha }}\n" > install/CI-ID.txt |
| 221 | + cp install/CI-ID.txt pdb/CI-ID.txt |
| 222 | +
|
| 223 | + - name: Store OpenMW archived pdb files |
| 224 | + uses: actions/upload-artifact@v4 |
| 225 | + with: |
| 226 | + name: openmw-${{ matrix.image }}-pdb-${{ github.sha }} |
| 227 | + path: ${{ github.workspace }}/pdb/* |
| 228 | + |
| 229 | + - name: Store OpenMW build artifacts |
| 230 | + uses: actions/upload-artifact@v4 |
| 231 | + with: |
| 232 | + name: openmw-${{ matrix.image }}-${{ github.sha }} |
| 233 | + path: ${{ github.workspace }}/install/* |
0 commit comments