diff --git a/.github/workflows/openmw.yml b/.github/workflows/openmw.yml index b0e05ea894..b9a88c82a9 100644 --- a/.github/workflows/openmw.yml +++ b/.github/workflows/openmw.yml @@ -6,7 +6,7 @@ on: env: BUILD_TYPE: RelWithDebInfo - VCPKG_DEPS_REVISION: 65ef3a6db0e01983efc7d8286f44020beeee2ea3 + VCPKG_DEPS_TAG: 2024-11-10 jobs: Ubuntu: @@ -94,12 +94,15 @@ jobs: fail-fast: true matrix: image: - - windows-2019 - - windows-2022 + - "2019" + - "2022" - name: ${{ matrix.image }} + name: windows-${{ matrix.image }} - runs-on: ${{ matrix.image }} + runs-on: windows-${{ matrix.image }} + + env: + archive: FAILEDTODOWNLOAD steps: - uses: actions/checkout@v2 @@ -111,14 +114,17 @@ jobs: - name: Download prebuilt vcpkg packages working-directory: ${{ github.workspace }}/deps - run: > - curl --fail --retry 3 -L - -o vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}.7z - https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}.7z + 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" + { read -r URL && read -r HASH FILE; } < "$MANIFEST" + curl --fail --retry 3 -L -o "$FILE" "$URL" + echo "$HASH $FILE" | shasum -a 512 --check + echo "archive=$FILE" >> "$GITHUB_ENV" - name: Extract archived prebuilt vcpkg packages working-directory: ${{ github.workspace }}/deps - run: 7z x -y -ovcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }} vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}.7z + run: 7z x -y -ovcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_TAG }} ${{ env.archive }} - name: Cache Qt id: qt-cache @@ -151,10 +157,10 @@ jobs: -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_REVISION }}/scripts/buildsystems/vcpkg.cmake' + -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_REVISION }}/installed/x64-windows/include/luajit' - -D LuaJit_LIBRARY='${{ github.workspace }}/deps/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}/installed/x64-windows/lib/lua51.lib' + -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 @@ -171,9 +177,9 @@ jobs: - name: Copy missing DLLs run: | - cp ${{ github.workspace }}/deps/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}/installed/x64-windows/bin/Release/MyGUIEngine.dll ${{ github.workspace }}/install - 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 - cp ${{ github.workspace }}/deps/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}/installed/x64-windows/bin/*.dll ${{ github.workspace }}/install + 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 @@ -212,20 +218,20 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | - job_url=$(gh run --repo ${{ github.repository }} view ${{ github.run_id }} --json jobs --jq '.jobs[] | select(.name == "${{ matrix.image }}") | .url') + 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-${{ matrix.image }}-pdb-${{ github.sha }} + 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-${{ matrix.image }}-${{ github.sha }} + name: openmw-windows-${{ matrix.image }}-${{ github.sha }} path: ${{ github.workspace }}/install/* - name: Add install directory to PATH diff --git a/CI/before_script.msvc.sh b/CI/before_script.msvc.sh index f16f241ff1..940c72c806 100644 --- a/CI/before_script.msvc.sh +++ b/CI/before_script.msvc.sh @@ -274,6 +274,20 @@ download() { fi } +MANIFEST_FILE="" +download_from_manifest() { + if [ $# -ne 1 ]; then + echo "Invalid parameters to download_from_manifest." + return 1 + fi + { read -r URL && read -r HASH FILE; } < $1 + if [ -z $SKIP_DOWNLOAD ]; then + download "${FILE:?}" "${URL:?}" "${FILE:?}" + fi + echo "${HASH:?} ${FILE:?}" | sha512sum --check + MANIFEST_FILE="${FILE:?}" +} + real_pwd() { if type cygpath >/dev/null 2>&1; then cygpath -am "$PWD" @@ -532,11 +546,11 @@ fi QT_VER='6.6.3' AQT_VERSION='v3.1.15' -VCPKG_REVISION='65ef3a6db0e01983efc7d8286f44020beeee2ea3' -VCPKG_PATH="vcpkg-x64-windows-${VS_VERSION:?}-${VCPKG_REVISION:?}" -VCPKG_ARCHIVE="${VCPKG_PATH:?}.7z" -VCPKG_PDB_PATH="vcpkg-x64-windows-${VS_VERSION:?}-pdb-${VCPKG_REVISION:?}" -VCPKG_PDB_ARCHIVE="${VCPKG_PDB_PATH:?}.7z" +VCPKG_TAG="2024-11-10" +VCPKG_PATH="vcpkg-x64-${VS_VERSION:?}-${VCPKG_TAG:?}" +VCPKG_PDB_PATH="vcpkg-x64-${VS_VERSION:?}-pdb-${VCPKG_TAG:?}" +VCPKG_MANIFEST="${VCPKG_PATH:?}.txt" +VCPKG_PDB_MANIFEST="${VCPKG_PDB_PATH:?}.txt" echo echo "===================================" @@ -553,14 +567,16 @@ if [ -z $SKIP_DOWNLOAD ]; then echo "Downloading dependency packages." echo - download "${VCPKG_PATH:?}" \ - "https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/${VCPKG_ARCHIVE:?}" \ - "${VCPKG_ARCHIVE:?}" + DEPS_BASE_URL="https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows" - if [ -n "${PDBS}" ]; then + download "${VCPKG_MANIFEST:?}" \ + "${DEPS_BASE_URL}/${VCPKG_MANIFEST:?}" \ + "${VCPKG_MANIFEST:?}" + + if [ -n "${VCPKG_PDB_MANIFEST:?}" ]; then download "${VCPKG_PDB_PATH:?}" \ - "https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/${VCPKG_PDB_ARCHIVE:?}" \ - "${VCPKG_PDB_ARCHIVE:?}" + "${DEPS_BASE_URL}/${VCPKG_PDB_MANIFEST:?}" \ + "${VCPKG_PDB_MANIFEST:?}" fi fi @@ -599,15 +615,20 @@ echo cd $DEPS echo -printf "vcpkg packages ${VCPKG_REVISION:?}... " +printf "vcpkg packages ${VCPKG_TAG:?}... " { if [[ -d "${VCPKG_PATH:?}" ]]; then printf "Exists. " else - eval 7z x -y -o"${VCPKG_PATH:?}" "${VCPKG_ARCHIVE:?}" ${STRIP} - - if [ -n "${PDBS}" ]; then - eval 7z x -y -o"${VCPKG_PATH:?}" "${VCPKG_PDB_ARCHIVE:?}" ${STRIP} + download_from_manifest "${VCPKG_MANIFEST:?}" + eval 7z x -y -o"${VCPKG_PATH:?}" "${MANIFEST_FILE:?}" ${STRIP} + fi + if [ -n "${PDBS}" ]; then + if [[ -d "${VCPKG_PDB_PATH:?}" ]]; then + printf "PDB exists. " + else + download_from_manifest "${VCPKG_PDB_MANIFEST:?}" + eval 7z x -y -o"${VCPKG_PDB_PATH:?}" "${MANIFEST_FILE:?}" ${STRIP} fi fi