From 90a1854848ea1b30cdb6ac9b1f45051c5679507d Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Mon, 9 Dec 2024 17:52:43 +0100 Subject: [PATCH 01/11] Split Windows builds to a reusable workflow --- .github/workflows/openmw.yml | 170 +------------------------------ .github/workflows/windows.yml | 184 ++++++++++++++++++++++++++++++++++ 2 files changed, 189 insertions(+), 165 deletions(-) create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/openmw.yml b/.github/workflows/openmw.yml index cfc1faa438..6afcc432d4 100644 --- a/.github/workflows/openmw.yml +++ b/.github/workflows/openmw.yml @@ -97,168 +97,8 @@ jobs: - "2019" - "2022" - name: windows-${{ matrix.image }} - - runs-on: windows-${{ matrix.image }} - - env: - archive: FAILEDTODOWNLOAD - - steps: - - uses: actions/checkout@v2 - - - name: Create directories for dependencies - run: | - mkdir -p ${{ github.workspace }}/deps - mkdir -p ${{ github.workspace }}/deps/Qt - - - name: Download prebuilt vcpkg packages - working-directory: ${{ github.workspace }}/deps - run: | - $MANIFEST = "vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_TAG }}.txt" - curl --fail --retry 3 -L -o "$MANIFEST" "https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/$MANIFEST" - $lines = Get-Content "$MANIFEST" - $URL = $lines[0] - $split = -split $lines[1] - $HASH = $split[0] - $FILE = $split[1] - curl --fail --retry 3 -L -o "$FILE" "$URL" - $filehash = Get-FileHash "$FILE" -Algorithm SHA512 - if ( $filehash.hash -ne "$HASH" ) { - exit 1 - } - echo "archive=$FILE" >> $env:GITHUB_ENV - - - name: Extract archived prebuilt vcpkg packages - working-directory: ${{ github.workspace }}/deps - run: 7z x -y -ovcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_TAG }} ${{ env.archive }} - - - name: Cache Qt - id: qt-cache - uses: actions/cache@v4 - with: - path: ${{ github.workspace }}/deps/Qt/6.6.3/msvc2019_64 - key: qt-cache-6.6.3-msvc2019_64-v1 - - - name: Download aqt - if: steps.qt-cache.outputs.cache-hit != 'true' - working-directory: ${{ github.workspace }}/deps/Qt - run: > - curl --fail --retry 3 -L - -o aqt_x64.exe - https://github.com/miurahr/aqtinstall/releases/download/v3.1.15/aqt_x64.exe - - - name: Install Qt with aqt - if: steps.qt-cache.outputs.cache-hit != 'true' - working-directory: ${{ github.workspace }}/deps/Qt - run: .\aqt_x64.exe install-qt windows desktop 6.6.3 win64_msvc2019_64 - - - uses: ilammy/msvc-dev-cmd@v1 - - - uses: seanmiddleditch/gha-setup-ninja@master - - - name: Configure OpenMW - run: > - cmake - -S . - -B ${{ github.workspace }}/build - -G Ninja - -D CMAKE_BUILD_TYPE=RelWithDebInfo - -D CMAKE_TOOLCHAIN_FILE='${{ github.workspace }}/deps/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_TAG }}/scripts/buildsystems/vcpkg.cmake' - -D CMAKE_PREFIX_PATH='${{ github.workspace }}/deps/Qt/6.6.3/msvc2019_64' - -D LuaJit_INCLUDE_DIR='${{ github.workspace }}/deps/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_TAG }}/installed/x64-windows/include/luajit' - -D LuaJit_LIBRARY='${{ github.workspace }}/deps/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_TAG }}/installed/x64-windows/lib/lua51.lib' - -D BUILD_BENCHMARKS=ON - -D BUILD_COMPONENTS_TESTS=ON - -D BUILD_OPENMW_TESTS=ON - -D BUILD_OPENCS_TESTS=ON - -D OPENMW_USE_SYSTEM_SQLITE3=OFF - -D OPENMW_USE_SYSTEM_YAML_CPP=OFF - -D OPENMW_LTO_BUILD=ON - - - name: Build OpenMW - run: cmake --build ${{ github.workspace }}/build - - - name: Install OpenMW - run: cmake --install ${{ github.workspace }}/build --prefix ${{ github.workspace }}/install - - - name: Copy missing DLLs - run: | - cp ${{ github.workspace }}/deps/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_TAG }}/installed/x64-windows/bin/Release/MyGUIEngine.dll ${{ github.workspace }}/install - cp -Filter *.dll -Recurse ${{ github.workspace }}/deps/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_TAG }}/installed/x64-windows/bin/osgPlugins-3.6.5 ${{ github.workspace }}/install - cp ${{ github.workspace }}/deps/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_TAG }}/installed/x64-windows/bin/*.dll ${{ github.workspace }}/install - - - name: Copy Qt DLLs - working-directory: ${{ github.workspace }}/deps/Qt/6.6.3/msvc2019_64 - run: | - cp bin/Qt6Core.dll ${{ github.workspace }}/install - cp bin/Qt6Gui.dll ${{ github.workspace }}/install - cp bin/Qt6Network.dll ${{ github.workspace }}/install - cp bin/Qt6OpenGL.dll ${{ github.workspace }}/install - cp bin/Qt6OpenGLWidgets.dll ${{ github.workspace }}/install - cp bin/Qt6Widgets.dll ${{ github.workspace }}/install - cp bin/Qt6Svg.dll ${{ github.workspace }}/install - mkdir ${{ github.workspace }}/install/styles - cp plugins/styles/qwindowsvistastyle.dll ${{ github.workspace }}/install/styles - mkdir ${{ github.workspace }}/install/platforms - cp plugins/platforms/qwindows.dll ${{ github.workspace }}/install/platforms - mkdir ${{ github.workspace }}/install/imageformats - cp plugins/imageformats/qsvg.dll ${{ github.workspace }}/install/imageformats - mkdir ${{ github.workspace }}/install/iconengines - cp plugins/iconengines/qsvgicon.dll ${{ github.workspace }}/install/iconengines - - - name: Move pdb files - run: | - robocopy install pdb *.pdb /MOVE - if ($lastexitcode -lt 8) { - $global:LASTEXITCODE = $null - } - - - name: Remove extra pdb files - shell: bash - run: | - rm -rf install/bin - rm -rf install/_deps - - - name: Generate CI-ID.txt - shell: bash - env: - GH_TOKEN: ${{ github.token }} - run: | - job_url=$(gh run --repo ${{ github.repository }} view ${{ github.run_id }} --json jobs --jq '.jobs[] | select(.name == "windows-${{ matrix.image }}") | .url') - printf "Ref ${{ github.ref }}\nJob ${job_url}\nCommit ${{ github.sha }}\n" > install/CI-ID.txt - cp install/CI-ID.txt pdb/CI-ID.txt - - - name: Store OpenMW archived pdb files - uses: actions/upload-artifact@v4 - with: - name: openmw-windows-${{ matrix.image }}-pdb-${{ github.sha }} - path: ${{ github.workspace }}/pdb/* - - - name: Store OpenMW build artifacts - uses: actions/upload-artifact@v4 - with: - name: openmw-windows-${{ matrix.image }}-${{ github.sha }} - path: ${{ github.workspace }}/install/* - - - name: Add install directory to PATH - shell: bash - run: echo '${{ github.workspace }}/install' >> ${GITHUB_PATH} - - - name: Run components tests - run: build/components-tests.exe - - - name: Run OpenMW tests - run: build/openmw-tests.exe - - - name: Run OpenMW-CS tests - run: build/openmw-cs-tests.exe - - - name: Run detournavigator navmeshtilescache benchmark - run: build/openmw_detournavigator_navmeshtilescache_benchmark.exe - - - name: Run settings access benchmark - run: build/openmw_settings_access_benchmark.exe - - - name: Run esm refid benchmark - run: build/openmw_esm_refid_benchmark.exe + uses: ./.github/workflows/windows.yml + with: + image: ${{ matrix.image }} + vcpkg-deps-tag: ${{ env.VCPKG_DEPS_TAG }} + build-type: ${{ env.BUILD_TYPE }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000000..11439d9429 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,184 @@ +name: Reusable Windows workflow + +on: + workflow_call: + inputs: + image: + description: MSVC image (2019/2022) + required: true + type: string + vcpkg-deps-tag: + description: Git tag of our deps + required: true + type: string + build-type: + default: RelWithDebInfo + type: string + +jobs: + Windows: + name: windows-${{ inputs.image }} + + runs-on: windows-${{ inputs.image }} + + env: + archive: FAILEDTODOWNLOAD + + steps: + - uses: actions/checkout@v2 + + - name: Create directories for dependencies + run: | + mkdir -p ${{ github.workspace }}/deps + mkdir -p ${{ github.workspace }}/deps/Qt + + - name: Download prebuilt vcpkg packages + working-directory: ${{ github.workspace }}/deps + run: | + $MANIFEST = "vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}.txt" + curl --fail --retry 3 -L -o "$MANIFEST" "https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/$MANIFEST" + $lines = Get-Content "$MANIFEST" + $URL = $lines[0] + $split = -split $lines[1] + $HASH = $split[0] + $FILE = $split[1] + curl --fail --retry 3 -L -o "$FILE" "$URL" + $filehash = Get-FileHash "$FILE" -Algorithm SHA512 + if ( $filehash.hash -ne "$HASH" ) { + exit 1 + } + echo "archive=$FILE" >> $env:GITHUB_ENV + + - name: Extract archived prebuilt vcpkg packages + working-directory: ${{ github.workspace }}/deps + run: 7z x -y -ovcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }} ${{ env.archive }} + + - name: Cache Qt + id: qt-cache + uses: actions/cache@v4 + with: + path: ${{ github.workspace }}/deps/Qt/6.6.3/msvc2019_64 + key: qt-cache-6.6.3-msvc2019_64-v1 + + - name: Download aqt + if: steps.qt-cache.outputs.cache-hit != 'true' + working-directory: ${{ github.workspace }}/deps/Qt + run: > + curl --fail --retry 3 -L + -o aqt_x64.exe + https://github.com/miurahr/aqtinstall/releases/download/v3.1.15/aqt_x64.exe + + - name: Install Qt with aqt + if: steps.qt-cache.outputs.cache-hit != 'true' + working-directory: ${{ github.workspace }}/deps/Qt + run: .\aqt_x64.exe install-qt windows desktop 6.6.3 win64_msvc2019_64 + + - uses: ilammy/msvc-dev-cmd@v1 + + - uses: seanmiddleditch/gha-setup-ninja@master + + - name: Configure OpenMW + run: > + cmake + -S . + -B ${{ github.workspace }}/build + -G Ninja + -D CMAKE_BUILD_TYPE=${{ inputs.build-type }} + -D CMAKE_TOOLCHAIN_FILE='${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/scripts/buildsystems/vcpkg.cmake' + -D CMAKE_PREFIX_PATH='${{ github.workspace }}/deps/Qt/6.6.3/msvc2019_64' + -D LuaJit_INCLUDE_DIR='${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/installed/x64-windows/include/luajit' + -D LuaJit_LIBRARY='${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/installed/x64-windows/lib/lua51.lib' + -D BUILD_BENCHMARKS=ON + -D BUILD_COMPONENTS_TESTS=ON + -D BUILD_OPENMW_TESTS=ON + -D BUILD_OPENCS_TESTS=ON + -D OPENMW_USE_SYSTEM_SQLITE3=OFF + -D OPENMW_USE_SYSTEM_YAML_CPP=OFF + -D OPENMW_LTO_BUILD=ON + + - name: Build OpenMW + run: cmake --build ${{ github.workspace }}/build + + - name: Install OpenMW + run: cmake --install ${{ github.workspace }}/build --prefix ${{ github.workspace }}/install + + - name: Copy missing DLLs + run: | + cp ${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/installed/x64-windows/bin/Release/MyGUIEngine.dll ${{ github.workspace }}/install + cp -Filter *.dll -Recurse ${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/installed/x64-windows/bin/osgPlugins-3.6.5 ${{ github.workspace }}/install + cp ${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/installed/x64-windows/bin/*.dll ${{ github.workspace }}/install + + - name: Copy Qt DLLs + working-directory: ${{ github.workspace }}/deps/Qt/6.6.3/msvc2019_64 + run: | + cp bin/Qt6Core.dll ${{ github.workspace }}/install + cp bin/Qt6Gui.dll ${{ github.workspace }}/install + cp bin/Qt6Network.dll ${{ github.workspace }}/install + cp bin/Qt6OpenGL.dll ${{ github.workspace }}/install + cp bin/Qt6OpenGLWidgets.dll ${{ github.workspace }}/install + cp bin/Qt6Widgets.dll ${{ github.workspace }}/install + cp bin/Qt6Svg.dll ${{ github.workspace }}/install + mkdir ${{ github.workspace }}/install/styles + cp plugins/styles/qwindowsvistastyle.dll ${{ github.workspace }}/install/styles + mkdir ${{ github.workspace }}/install/platforms + cp plugins/platforms/qwindows.dll ${{ github.workspace }}/install/platforms + mkdir ${{ github.workspace }}/install/imageformats + cp plugins/imageformats/qsvg.dll ${{ github.workspace }}/install/imageformats + mkdir ${{ github.workspace }}/install/iconengines + cp plugins/iconengines/qsvgicon.dll ${{ github.workspace }}/install/iconengines + + - name: Move pdb files + run: | + robocopy install pdb *.pdb /MOVE + if ($lastexitcode -lt 8) { + $global:LASTEXITCODE = $null + } + + - name: Remove extra pdb files + shell: bash + run: | + rm -rf install/bin + rm -rf install/_deps + + - name: Generate CI-ID.txt + shell: bash + env: + GH_TOKEN: ${{ github.token }} + run: | + job_url=$(gh run --repo ${{ github.repository }} view ${{ github.run_id }} --json jobs --jq '.jobs[] | select(.name == "windows-${{ inputs.image }}") | .url') + printf "Ref ${{ github.ref }}\nJob ${job_url}\nCommit ${{ github.sha }}\n" > install/CI-ID.txt + cp install/CI-ID.txt pdb/CI-ID.txt + + - name: Store OpenMW archived pdb files + uses: actions/upload-artifact@v4 + with: + name: openmw-windows-${{ inputs.image }}-pdb-${{ github.sha }} + path: ${{ github.workspace }}/pdb/* + + - name: Store OpenMW build artifacts + uses: actions/upload-artifact@v4 + with: + name: openmw-windows-${{ inputs.image }}-${{ github.sha }} + path: ${{ github.workspace }}/install/* + + - name: Add install directory to PATH + shell: bash + run: echo '${{ github.workspace }}/install' >> ${GITHUB_PATH} + + - name: Run components tests + run: build/components-tests.exe + + - name: Run OpenMW tests + run: build/openmw-tests.exe + + - name: Run OpenMW-CS tests + run: build/openmw-cs-tests.exe + + - name: Run detournavigator navmeshtilescache benchmark + run: build/openmw_detournavigator_navmeshtilescache_benchmark.exe + + - name: Run settings access benchmark + run: build/openmw_settings_access_benchmark.exe + + - name: Run esm refid benchmark + run: build/openmw_esm_refid_benchmark.exe From 853c4287d2552030a9690c323c4cd99262489d2b Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Mon, 9 Dec 2024 18:06:30 +0100 Subject: [PATCH 02/11] Pass env vars as output --- .github/workflows/openmw.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/openmw.yml b/.github/workflows/openmw.yml index 6afcc432d4..f29155007c 100644 --- a/.github/workflows/openmw.yml +++ b/.github/workflows/openmw.yml @@ -89,7 +89,20 @@ jobs: cd build make -j $(sysctl -n hw.logicalcpu) package + # This is a fairly silly job to work around `env` not being available in `with` + Output-Envs: + name: Pass environment variables along + runs-on: ubuntu-latest + outputs: + VCPKG_DEPS_TAG: ${{ env.VCPKG_DEPS_TAG }} + BUILD_TYPE: ${{ env.BUILD_TYPE }} + steps: + - run: echo "Doing nothing" + Windows: + needs: + - Output-Envs + strategy: fail-fast: true matrix: @@ -100,5 +113,5 @@ jobs: uses: ./.github/workflows/windows.yml with: image: ${{ matrix.image }} - vcpkg-deps-tag: ${{ env.VCPKG_DEPS_TAG }} - build-type: ${{ env.BUILD_TYPE }} + vcpkg-deps-tag: ${{ needs.Output-Envs.outputs.VCPKG_DEPS_TAG }} + build-type: ${{ needs.Output-Envs.outputs.BUILD_TYPE }} From 793a56a8823e106ca533f4d2e6a7adc4f72181fe Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Tue, 10 Dec 2024 20:30:47 +0100 Subject: [PATCH 03/11] Try to build in Release mode --- .github/workflows/{openmw.yml => push.yml} | 16 +++++++++++---- .github/workflows/release.yml | 24 ++++++++++++++++++++++ .github/workflows/windows.yml | 9 ++++++++ CI/github.env | 1 + 4 files changed, 46 insertions(+), 4 deletions(-) rename .github/workflows/{openmw.yml => push.yml} (90%) create mode 100644 .github/workflows/release.yml create mode 100644 CI/github.env diff --git a/.github/workflows/openmw.yml b/.github/workflows/push.yml similarity index 90% rename from .github/workflows/openmw.yml rename to .github/workflows/push.yml index f29155007c..2e85fedafc 100644 --- a/.github/workflows/openmw.yml +++ b/.github/workflows/push.yml @@ -6,10 +6,12 @@ on: env: BUILD_TYPE: RelWithDebInfo - VCPKG_DEPS_TAG: 2024-11-10 jobs: Ubuntu: + # TODO remove + if: false + runs-on: ubuntu-latest steps: @@ -68,6 +70,9 @@ jobs: # name: build_artifact.7z MacOS: + # TODO remove + if: false + runs-on: macos-latest steps: @@ -89,17 +94,20 @@ jobs: cd build make -j $(sysctl -n hw.logicalcpu) package - # This is a fairly silly job to work around `env` not being available in `with` Output-Envs: - name: Pass environment variables along + name: Read .env file and expose it as output runs-on: ubuntu-latest outputs: VCPKG_DEPS_TAG: ${{ env.VCPKG_DEPS_TAG }} BUILD_TYPE: ${{ env.BUILD_TYPE }} steps: - - run: echo "Doing nothing" + - uses: actions/checkout@v2 + - run: cat "${{ github.workspace }}/CI/github.env" >> $GITHUB_ENV Windows: + # TODO remove + if: false + needs: - Output-Envs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..67551d6c0b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,24 @@ +name: Release + +on: + - push + +jobs: + Output-Envs: + name: Read .env file and expose it as output + runs-on: ubuntu-latest + outputs: + VCPKG_DEPS_TAG: ${{ env.VCPKG_DEPS_TAG }} + steps: + - uses: actions/checkout@v2 + - run: cat "${{ github.workspace }}/CI/github.env" >> $GITHUB_ENV + + Windows: + needs: + - Output-Envs + uses: ./.github/workflows/windows.yml + with: + image: "2022" + vcpkg-deps-tag: ${{ needs.Output-Envs.outputs.VCPKG_DEPS_TAG }} + build-type: Release + package: true diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 11439d9429..45706e4ffc 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -14,6 +14,9 @@ on: build-type: default: RelWithDebInfo type: string + package: + default: false + type: boolean jobs: Windows: @@ -166,19 +169,25 @@ jobs: run: echo '${{ github.workspace }}/install' >> ${GITHUB_PATH} - name: Run components tests + if: ${{ ! inputs.package }} run: build/components-tests.exe - name: Run OpenMW tests + if: ${{ ! inputs.package }} run: build/openmw-tests.exe - name: Run OpenMW-CS tests + if: ${{ ! inputs.package }} run: build/openmw-cs-tests.exe - name: Run detournavigator navmeshtilescache benchmark + if: ${{ ! inputs.package }} run: build/openmw_detournavigator_navmeshtilescache_benchmark.exe - name: Run settings access benchmark + if: ${{ ! inputs.package }} run: build/openmw_settings_access_benchmark.exe - name: Run esm refid benchmark + if: ${{ ! inputs.package }} run: build/openmw_esm_refid_benchmark.exe diff --git a/CI/github.env b/CI/github.env new file mode 100644 index 0000000000..d8ca8b429f --- /dev/null +++ b/CI/github.env @@ -0,0 +1 @@ +VCPKG_DEPS_TAG=2024-11-10 From aa0a15a1266522372999b4eb4a1a9484136aec1f Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Tue, 10 Dec 2024 22:17:42 +0100 Subject: [PATCH 04/11] Attempt to run cpack --- .github/workflows/windows.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 45706e4ffc..a4448e6b12 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -28,6 +28,10 @@ jobs: archive: FAILEDTODOWNLOAD steps: + - name: Install NSIS + if: ${{ inputs.package }} + run: choco install nsis + - uses: actions/checkout@v2 - name: Create directories for dependencies @@ -89,12 +93,14 @@ jobs: -D CMAKE_BUILD_TYPE=${{ inputs.build-type }} -D CMAKE_TOOLCHAIN_FILE='${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/scripts/buildsystems/vcpkg.cmake' -D CMAKE_PREFIX_PATH='${{ github.workspace }}/deps/Qt/6.6.3/msvc2019_64' + ${{ inputs.package && '-D CMAKE_CXX_FLAGS_RELEASE="/O2 /Ob2 /DNDEBUG"' || '' }} + ${{ inputs.package && '-D "CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=/DEBUG /INCREMENTAL:NO"' || '' }} -D LuaJit_INCLUDE_DIR='${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/installed/x64-windows/include/luajit' -D LuaJit_LIBRARY='${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/installed/x64-windows/lib/lua51.lib' - -D BUILD_BENCHMARKS=ON - -D BUILD_COMPONENTS_TESTS=ON - -D BUILD_OPENMW_TESTS=ON - -D BUILD_OPENCS_TESTS=ON + -D BUILD_BENCHMARKS=${{ inputs.package && 'OFF' || 'ON' }} + -D BUILD_COMPONENTS_TESTS=${{ inputs.package && 'OFF' || 'ON' }} + -D BUILD_OPENMW_TESTS=${{ inputs.package && 'OFF' || 'ON' }} + -D BUILD_OPENCS_TESTS=${{ inputs.package && 'OFF' || 'ON' }} -D OPENMW_USE_SYSTEM_SQLITE3=OFF -D OPENMW_USE_SYSTEM_YAML_CPP=OFF -D OPENMW_LTO_BUILD=ON @@ -103,15 +109,18 @@ jobs: run: cmake --build ${{ github.workspace }}/build - name: Install OpenMW + if: ${{ ! inputs.package }} run: cmake --install ${{ github.workspace }}/build --prefix ${{ github.workspace }}/install - name: Copy missing DLLs + if: ${{ ! inputs.package }} run: | cp ${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/installed/x64-windows/bin/Release/MyGUIEngine.dll ${{ github.workspace }}/install cp -Filter *.dll -Recurse ${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/installed/x64-windows/bin/osgPlugins-3.6.5 ${{ github.workspace }}/install cp ${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/installed/x64-windows/bin/*.dll ${{ github.workspace }}/install - name: Copy Qt DLLs + if: ${{ ! inputs.package }} working-directory: ${{ github.workspace }}/deps/Qt/6.6.3/msvc2019_64 run: | cp bin/Qt6Core.dll ${{ github.workspace }}/install @@ -131,6 +140,7 @@ jobs: cp plugins/iconengines/qsvgicon.dll ${{ github.workspace }}/install/iconengines - name: Move pdb files + if: ${{ ! inputs.package }} run: | robocopy install pdb *.pdb /MOVE if ($lastexitcode -lt 8) { @@ -138,12 +148,14 @@ jobs: } - name: Remove extra pdb files + if: ${{ ! inputs.package }} shell: bash run: | rm -rf install/bin rm -rf install/_deps - name: Generate CI-ID.txt + if: ${{ ! inputs.package }} shell: bash env: GH_TOKEN: ${{ github.token }} @@ -152,6 +164,10 @@ jobs: printf "Ref ${{ github.ref }}\nJob ${job_url}\nCommit ${{ github.sha }}\n" > install/CI-ID.txt cp install/CI-ID.txt pdb/CI-ID.txt + - name: Package OpenMW + if: ${{ inputs.package }} + run: cpack --config "${{ github.workspace }}/build/CPackConfig.cmake" + - name: Store OpenMW archived pdb files uses: actions/upload-artifact@v4 with: From 6d6d73eca46e363c7bc2ac6aed7dcb47ddd19dab Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Wed, 11 Dec 2024 17:48:41 +0100 Subject: [PATCH 05/11] Package to /install --- .github/workflows/windows.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a4448e6b12..ff452ac7a1 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -140,9 +140,8 @@ jobs: cp plugins/iconengines/qsvgicon.dll ${{ github.workspace }}/install/iconengines - name: Move pdb files - if: ${{ ! inputs.package }} run: | - robocopy install pdb *.pdb /MOVE + robocopy ${{ inputs.package && 'build' || 'install' }} pdb *.pdb /MOVE if ($lastexitcode -lt 8) { $global:LASTEXITCODE = $null } @@ -154,8 +153,13 @@ jobs: rm -rf install/bin rm -rf install/_deps + - name: Package OpenMW + if: ${{ inputs.package }} + run: | + echo "${{ env.VCToolsRedistDir }}" + cpack --config "${{ github.workspace }}/build/CPackConfig.cmake" -B "${{ github.workspace }}/install" + - name: Generate CI-ID.txt - if: ${{ ! inputs.package }} shell: bash env: GH_TOKEN: ${{ github.token }} @@ -164,10 +168,6 @@ jobs: printf "Ref ${{ github.ref }}\nJob ${job_url}\nCommit ${{ github.sha }}\n" > install/CI-ID.txt cp install/CI-ID.txt pdb/CI-ID.txt - - name: Package OpenMW - if: ${{ inputs.package }} - run: cpack --config "${{ github.workspace }}/build/CPackConfig.cmake" - - name: Store OpenMW archived pdb files uses: actions/upload-artifact@v4 with: From fe5c9078cac11a8c3df5098d9230f2761af00a4d Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Wed, 11 Dec 2024 18:41:20 +0100 Subject: [PATCH 06/11] Copy dlls --- .github/workflows/windows.yml | 58 +++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index ff452ac7a1..c98e95199d 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -110,34 +110,44 @@ jobs: - name: Install OpenMW if: ${{ ! inputs.package }} - run: cmake --install ${{ github.workspace }}/build --prefix ${{ github.workspace }}/install + run: | + cmake --install ${{ github.workspace }}/build --prefix ${{ github.workspace }}/install + echo "dlldir=${{ github.workspace }}/install" >> $env:GITHUB_ENV + + - name: Ensure DLLs end up in the build dir + if: ${{ inputs.package }} + run: echo "dlldir=${{ github.workspace }}/build" >> $env:GITHUB_ENV - name: Copy missing DLLs - if: ${{ ! inputs.package }} run: | - cp ${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/installed/x64-windows/bin/Release/MyGUIEngine.dll ${{ github.workspace }}/install - cp -Filter *.dll -Recurse ${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/installed/x64-windows/bin/osgPlugins-3.6.5 ${{ github.workspace }}/install - cp ${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/installed/x64-windows/bin/*.dll ${{ github.workspace }}/install + cp ${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/installed/x64-windows/bin/Release/MyGUIEngine.dll ${{ env.dlldir }} + cp -Filter *.dll -Recurse ${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/installed/x64-windows/bin/osgPlugins-3.6.5 ${{ env.dlldir }} + cp ${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/installed/x64-windows/bin/*.dll ${{ env.dlldir }} - name: Copy Qt DLLs - if: ${{ ! inputs.package }} working-directory: ${{ github.workspace }}/deps/Qt/6.6.3/msvc2019_64 run: | - cp bin/Qt6Core.dll ${{ github.workspace }}/install - cp bin/Qt6Gui.dll ${{ github.workspace }}/install - cp bin/Qt6Network.dll ${{ github.workspace }}/install - cp bin/Qt6OpenGL.dll ${{ github.workspace }}/install - cp bin/Qt6OpenGLWidgets.dll ${{ github.workspace }}/install - cp bin/Qt6Widgets.dll ${{ github.workspace }}/install - cp bin/Qt6Svg.dll ${{ github.workspace }}/install - mkdir ${{ github.workspace }}/install/styles - cp plugins/styles/qwindowsvistastyle.dll ${{ github.workspace }}/install/styles - mkdir ${{ github.workspace }}/install/platforms - cp plugins/platforms/qwindows.dll ${{ github.workspace }}/install/platforms - mkdir ${{ github.workspace }}/install/imageformats - cp plugins/imageformats/qsvg.dll ${{ github.workspace }}/install/imageformats - mkdir ${{ github.workspace }}/install/iconengines - cp plugins/iconengines/qsvgicon.dll ${{ github.workspace }}/install/iconengines + cp bin/Qt6Core.dll ${{ env.dlldir }} + cp bin/Qt6Gui.dll ${{ env.dlldir }} + cp bin/Qt6Network.dll ${{ env.dlldir }} + cp bin/Qt6OpenGL.dll ${{ env.dlldir }} + cp bin/Qt6OpenGLWidgets.dll ${{ env.dlldir }} + cp bin/Qt6Widgets.dll ${{ env.dlldir }} + cp bin/Qt6Svg.dll ${{ env.dlldir }} + mkdir ${{ env.dlldir }}/styles + cp plugins/styles/qwindowsvistastyle.dll ${{ env.dlldir }}/styles + mkdir ${{ env.dlldir }}/platforms + cp plugins/platforms/qwindows.dll ${{ env.dlldir }}/platforms + mkdir ${{ env.dlldir }}/imageformats + cp plugins/imageformats/qsvg.dll ${{ env.dlldir }}/imageformats + mkdir ${{ env.dlldir }}/iconengines + cp plugins/iconengines/qsvgicon.dll ${{ env.dlldir }}/iconengines + + - name: Package OpenMW + if: ${{ inputs.package }} + run: | + cpack --config "${{ github.workspace }}/build/CPackConfig.cmake" -B "${{ github.workspace }}/install" + rm -r -f "${{ github.workspace }}/install/_CPack_Packages" - name: Move pdb files run: | @@ -153,12 +163,6 @@ jobs: rm -rf install/bin rm -rf install/_deps - - name: Package OpenMW - if: ${{ inputs.package }} - run: | - echo "${{ env.VCToolsRedistDir }}" - cpack --config "${{ github.workspace }}/build/CPackConfig.cmake" -B "${{ github.workspace }}/install" - - name: Generate CI-ID.txt shell: bash env: From a1f736d765b9e6ea73b6d7e8a5545323861e8386 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Wed, 11 Dec 2024 19:41:07 +0100 Subject: [PATCH 07/11] Add vcredist --- .github/workflows/windows.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c98e95199d..dbf16158f1 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -116,7 +116,9 @@ jobs: - name: Ensure DLLs end up in the build dir if: ${{ inputs.package }} - run: echo "dlldir=${{ github.workspace }}/build" >> $env:GITHUB_ENV + run: | + cp "${{ env.VCToolsRedistDir }}/vc_redist.x64.exe" "${{ github.workspace }}/build" + echo "dlldir=${{ github.workspace }}/build" >> $env:GITHUB_ENV - name: Copy missing DLLs run: | @@ -147,7 +149,7 @@ jobs: if: ${{ inputs.package }} run: | cpack --config "${{ github.workspace }}/build/CPackConfig.cmake" -B "${{ github.workspace }}/install" - rm -r -f "${{ github.workspace }}/install/_CPack_Packages" + rm -r -Force "${{ github.workspace }}/install/_CPack_Packages" - name: Move pdb files run: | From da68130c08c91d16e2a59e8bcd04dd23e33a01b4 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Wed, 11 Dec 2024 20:38:23 +0100 Subject: [PATCH 08/11] Turn VCREDIST into a cache variable --- .github/workflows/windows.yml | 5 ++--- CMakeLists.txt | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index dbf16158f1..b00b8c1a31 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -104,6 +104,7 @@ jobs: -D OPENMW_USE_SYSTEM_SQLITE3=OFF -D OPENMW_USE_SYSTEM_YAML_CPP=OFF -D OPENMW_LTO_BUILD=ON + ${{ inputs.package && format('-D "VCREDIST64={0}/vc_redist.x64.exe"', env.VCToolsRedistDir) || '' }} - name: Build OpenMW run: cmake --build ${{ github.workspace }}/build @@ -116,9 +117,7 @@ jobs: - name: Ensure DLLs end up in the build dir if: ${{ inputs.package }} - run: | - cp "${{ env.VCToolsRedistDir }}/vc_redist.x64.exe" "${{ github.workspace }}/build" - echo "dlldir=${{ github.workspace }}/build" >> $env:GITHUB_ENV + run: echo "dlldir=${{ github.workspace }}/build" >> $env:GITHUB_ENV - name: Copy missing DLLs run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 80a50297ef..51f35fa0a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1006,13 +1006,13 @@ elseif(NOT APPLE) SET(CPACK_NSIS_MUI_UNIICON "${OpenMW_SOURCE_DIR}/files/windows/openmw.ico") SET(CPACK_PACKAGE_ICON "${OpenMW_SOURCE_DIR}\\\\files\\\\openmw.bmp") - SET(VCREDIST32 "${OpenMW_BINARY_DIR}/vcredist_x86.exe") + SET(VCREDIST32 "${OpenMW_BINARY_DIR}/vcredist_x86.exe" CACHE FILEPATH "Path to vcredist_x86.exe") if(EXISTS ${VCREDIST32}) INSTALL(FILES ${VCREDIST32} DESTINATION "redist") SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait '\\\"$INSTDIR\\\\redist\\\\vcredist_x86.exe\\\" /q /norestart'" ) endif(EXISTS ${VCREDIST32}) - SET(VCREDIST64 "${OpenMW_BINARY_DIR}/vcredist_x64.exe") + SET(VCREDIST64 "${OpenMW_BINARY_DIR}/vcredist_x64.exe" CACHE FILEPATH "Path to vcredist_x64.exe") if(EXISTS ${VCREDIST64}) INSTALL(FILES ${VCREDIST64} DESTINATION "redist") SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait '\\\"$INSTDIR\\\\redist\\\\vcredist_x64.exe\\\" /q /norestart'" ) From 239c865eca8d49cec98439fe1befff4055277f68 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Wed, 11 Dec 2024 21:33:14 +0100 Subject: [PATCH 09/11] Run release on tag --- .github/workflows/push.yml | 9 --------- .github/workflows/release.yml | 4 +++- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 2e85fedafc..f14532e1e0 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -9,9 +9,6 @@ env: jobs: Ubuntu: - # TODO remove - if: false - runs-on: ubuntu-latest steps: @@ -70,9 +67,6 @@ jobs: # name: build_artifact.7z MacOS: - # TODO remove - if: false - runs-on: macos-latest steps: @@ -105,9 +99,6 @@ jobs: - run: cat "${{ github.workspace }}/CI/github.env" >> $GITHUB_ENV Windows: - # TODO remove - if: false - needs: - Output-Envs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 67551d6c0b..3a8c44f9dc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,9 @@ name: Release on: - - push + push: + tags: + - openmw-** jobs: Output-Envs: From 604f16a0a07d513f71c6b475f4d58202375adba8 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Thu, 12 Dec 2024 17:27:26 +0100 Subject: [PATCH 10/11] Remove redistributables we no longer use --- CMakeLists.txt | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 51f35fa0a4..728ba2ef22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1006,25 +1006,12 @@ elseif(NOT APPLE) SET(CPACK_NSIS_MUI_UNIICON "${OpenMW_SOURCE_DIR}/files/windows/openmw.ico") SET(CPACK_PACKAGE_ICON "${OpenMW_SOURCE_DIR}\\\\files\\\\openmw.bmp") - SET(VCREDIST32 "${OpenMW_BINARY_DIR}/vcredist_x86.exe" CACHE FILEPATH "Path to vcredist_x86.exe") - if(EXISTS ${VCREDIST32}) - INSTALL(FILES ${VCREDIST32} DESTINATION "redist") - SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait '\\\"$INSTDIR\\\\redist\\\\vcredist_x86.exe\\\" /q /norestart'" ) - endif(EXISTS ${VCREDIST32}) - SET(VCREDIST64 "${OpenMW_BINARY_DIR}/vcredist_x64.exe" CACHE FILEPATH "Path to vcredist_x64.exe") if(EXISTS ${VCREDIST64}) INSTALL(FILES ${VCREDIST64} DESTINATION "redist") SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait '\\\"$INSTDIR\\\\redist\\\\vcredist_x64.exe\\\" /q /norestart'" ) endif(EXISTS ${VCREDIST64}) - SET(OALREDIST "${OpenMW_BINARY_DIR}/oalinst.exe") - if(EXISTS ${OALREDIST}) - INSTALL(FILES ${OALREDIST} DESTINATION "redist") - SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS} - ExecWait '\\\"$INSTDIR\\\\redist\\\\oalinst.exe\\\" /s'" ) - endif(EXISTS ${OALREDIST}) - if(CMAKE_CL_64) SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") endif() From 5a37cb8bed08af6eee783ce5919a29800a5a9d80 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Thu, 12 Dec 2024 19:16:40 +0100 Subject: [PATCH 11/11] Address feedback --- .github/workflows/push.yml | 8 ++-- .github/workflows/release.yml | 2 +- .github/workflows/windows.yml | 82 ++++++++++++++++------------------- 3 files changed, 43 insertions(+), 49 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index f14532e1e0..41fa39b78d 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -1,4 +1,4 @@ -name: CMake +name: Build and test on: - push @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Add OpenMW PPA Dependencies run: sudo add-apt-repository ppa:openmw/openmw; sudo apt-get update @@ -70,7 +70,7 @@ jobs: runs-on: macos-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Building Dependencies run: CI/before_install.osx.sh @@ -95,7 +95,7 @@ jobs: VCPKG_DEPS_TAG: ${{ env.VCPKG_DEPS_TAG }} BUILD_TYPE: ${{ env.BUILD_TYPE }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - run: cat "${{ github.workspace }}/CI/github.env" >> $GITHUB_ENV Windows: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3a8c44f9dc..d8d8d9ca6a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: outputs: VCPKG_DEPS_TAG: ${{ env.VCPKG_DEPS_TAG }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - run: cat "${{ github.workspace }}/CI/github.env" >> $GITHUB_ENV Windows: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index b00b8c1a31..5d3f030abc 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -32,7 +32,7 @@ jobs: if: ${{ inputs.package }} run: choco install nsis - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Create directories for dependencies run: | @@ -58,7 +58,7 @@ jobs: - name: Extract archived prebuilt vcpkg packages working-directory: ${{ github.workspace }}/deps - run: 7z x -y -ovcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }} ${{ env.archive }} + run: 7z x -y -ovcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }} $env:archive - name: Cache Qt id: qt-cache @@ -93,70 +93,64 @@ jobs: -D CMAKE_BUILD_TYPE=${{ inputs.build-type }} -D CMAKE_TOOLCHAIN_FILE='${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/scripts/buildsystems/vcpkg.cmake' -D CMAKE_PREFIX_PATH='${{ github.workspace }}/deps/Qt/6.6.3/msvc2019_64' - ${{ inputs.package && '-D CMAKE_CXX_FLAGS_RELEASE="/O2 /Ob2 /DNDEBUG"' || '' }} - ${{ inputs.package && '-D "CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=/DEBUG /INCREMENTAL:NO"' || '' }} + ${{ inputs.package && '-D CMAKE_CXX_FLAGS_RELEASE="/O2 /Ob2 /DNDEBUG /Zi"' || '' }} + ${{ inputs.package && '-D "CMAKE_EXE_LINKER_FLAGS_RELEASE=/DEBUG /INCREMENTAL:NO"' || '' }} -D LuaJit_INCLUDE_DIR='${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/installed/x64-windows/include/luajit' -D LuaJit_LIBRARY='${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/installed/x64-windows/lib/lua51.lib' - -D BUILD_BENCHMARKS=${{ inputs.package && 'OFF' || 'ON' }} - -D BUILD_COMPONENTS_TESTS=${{ inputs.package && 'OFF' || 'ON' }} - -D BUILD_OPENMW_TESTS=${{ inputs.package && 'OFF' || 'ON' }} - -D BUILD_OPENCS_TESTS=${{ inputs.package && 'OFF' || 'ON' }} + -D BUILD_BENCHMARKS=${{ ! inputs.package }} + -D BUILD_COMPONENTS_TESTS=${{ ! inputs.package }} + -D BUILD_OPENMW_TESTS=${{ ! inputs.package }} + -D BUILD_OPENCS_TESTS=${{ ! inputs.package }} -D OPENMW_USE_SYSTEM_SQLITE3=OFF -D OPENMW_USE_SYSTEM_YAML_CPP=OFF -D OPENMW_LTO_BUILD=ON - ${{ inputs.package && format('-D "VCREDIST64={0}/vc_redist.x64.exe"', env.VCToolsRedistDir) || '' }} + ${{ inputs.package && '-D "VCREDIST64=$env:VCToolsRedistDir/vc_redist.x64.exe"' || '' }} - name: Build OpenMW run: cmake --build ${{ github.workspace }}/build - - name: Install OpenMW - if: ${{ ! inputs.package }} - run: | - cmake --install ${{ github.workspace }}/build --prefix ${{ github.workspace }}/install - echo "dlldir=${{ github.workspace }}/install" >> $env:GITHUB_ENV - - - name: Ensure DLLs end up in the build dir - if: ${{ inputs.package }} - run: echo "dlldir=${{ github.workspace }}/build" >> $env:GITHUB_ENV - - name: Copy missing DLLs run: | - cp ${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/installed/x64-windows/bin/Release/MyGUIEngine.dll ${{ env.dlldir }} - cp -Filter *.dll -Recurse ${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/installed/x64-windows/bin/osgPlugins-3.6.5 ${{ env.dlldir }} - cp ${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/installed/x64-windows/bin/*.dll ${{ env.dlldir }} + cp ${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/installed/x64-windows/bin/Release/MyGUIEngine.dll ${{ github.workspace }}/build + cp -Filter *.dll -Recurse ${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/installed/x64-windows/bin/osgPlugins-3.6.5 ${{ github.workspace }}/build + cp ${{ github.workspace }}/deps/vcpkg-x64-${{ inputs.image }}-${{ inputs.vcpkg-deps-tag }}/installed/x64-windows/bin/*.dll ${{ github.workspace }}/build - name: Copy Qt DLLs working-directory: ${{ github.workspace }}/deps/Qt/6.6.3/msvc2019_64 run: | - cp bin/Qt6Core.dll ${{ env.dlldir }} - cp bin/Qt6Gui.dll ${{ env.dlldir }} - cp bin/Qt6Network.dll ${{ env.dlldir }} - cp bin/Qt6OpenGL.dll ${{ env.dlldir }} - cp bin/Qt6OpenGLWidgets.dll ${{ env.dlldir }} - cp bin/Qt6Widgets.dll ${{ env.dlldir }} - cp bin/Qt6Svg.dll ${{ env.dlldir }} - mkdir ${{ env.dlldir }}/styles - cp plugins/styles/qwindowsvistastyle.dll ${{ env.dlldir }}/styles - mkdir ${{ env.dlldir }}/platforms - cp plugins/platforms/qwindows.dll ${{ env.dlldir }}/platforms - mkdir ${{ env.dlldir }}/imageformats - cp plugins/imageformats/qsvg.dll ${{ env.dlldir }}/imageformats - mkdir ${{ env.dlldir }}/iconengines - cp plugins/iconengines/qsvgicon.dll ${{ env.dlldir }}/iconengines - - - name: Package OpenMW - if: ${{ inputs.package }} - run: | - cpack --config "${{ github.workspace }}/build/CPackConfig.cmake" -B "${{ github.workspace }}/install" - rm -r -Force "${{ github.workspace }}/install/_CPack_Packages" + cp bin/Qt6Core.dll ${{ github.workspace }}/build + cp bin/Qt6Gui.dll ${{ github.workspace }}/build + cp bin/Qt6Network.dll ${{ github.workspace }}/build + cp bin/Qt6OpenGL.dll ${{ github.workspace }}/build + cp bin/Qt6OpenGLWidgets.dll ${{ github.workspace }}/build + cp bin/Qt6Widgets.dll ${{ github.workspace }}/build + cp bin/Qt6Svg.dll ${{ github.workspace }}/build + mkdir ${{ github.workspace }}/build/styles + cp plugins/styles/qwindowsvistastyle.dll ${{ github.workspace }}/build/styles + mkdir ${{ github.workspace }}/build/platforms + cp plugins/platforms/qwindows.dll ${{ github.workspace }}/build/platforms + mkdir ${{ github.workspace }}/build/imageformats + cp plugins/imageformats/qsvg.dll ${{ github.workspace }}/build/imageformats + mkdir ${{ github.workspace }}/build/iconengines + cp plugins/iconengines/qsvgicon.dll ${{ github.workspace }}/build/iconengines - name: Move pdb files run: | - robocopy ${{ inputs.package && 'build' || 'install' }} pdb *.pdb /MOVE + robocopy build pdb *.pdb /MOVE if ($lastexitcode -lt 8) { $global:LASTEXITCODE = $null } + - name: Install OpenMW + if: ${{ ! inputs.package }} + run: cmake --install ${{ github.workspace }}/build --prefix ${{ github.workspace }}/install + + - name: Package OpenMW + if: ${{ inputs.package }} + run: | + cpack --config "${{ github.workspace }}/build/CPackConfig.cmake" -B "${{ github.workspace }}/install" + rm -r -Force "${{ github.workspace }}/install/_CPack_Packages" + - name: Remove extra pdb files if: ${{ ! inputs.package }} shell: bash