Switch to downloading dependencies from Github releases

master
Evil Eye 2 months ago
parent f5c457c474
commit 7b064920db

@ -6,7 +6,7 @@ on:
env: env:
BUILD_TYPE: RelWithDebInfo BUILD_TYPE: RelWithDebInfo
VCPKG_DEPS_REVISION: 65ef3a6db0e01983efc7d8286f44020beeee2ea3 VCPKG_DEPS_TAG: 2024-11-10
jobs: jobs:
Ubuntu: Ubuntu:
@ -94,12 +94,15 @@ jobs:
fail-fast: true fail-fast: true
matrix: matrix:
image: image:
- windows-2019 - "2019"
- windows-2022 - "2022"
name: ${{ matrix.image }} name: windows-${{ matrix.image }}
runs-on: ${{ matrix.image }} runs-on: windows-${{ matrix.image }}
env:
archive: FAILEDTODOWNLOAD
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -111,14 +114,17 @@ jobs:
- name: Download prebuilt vcpkg packages - name: Download prebuilt vcpkg packages
working-directory: ${{ github.workspace }}/deps working-directory: ${{ github.workspace }}/deps
run: > run: |
curl --fail --retry 3 -L MANIFEST="vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_TAG }}.txt"
-o vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}.7z curl --fail --retry 3 -L -o "$MANIFEST" "https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/$MANIFEST"
https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}.7z { 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 - name: Extract archived prebuilt vcpkg packages
working-directory: ${{ github.workspace }}/deps 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 - name: Cache Qt
id: qt-cache id: qt-cache
@ -151,10 +157,10 @@ jobs:
-B ${{ github.workspace }}/build -B ${{ github.workspace }}/build
-G Ninja -G Ninja
-D CMAKE_BUILD_TYPE=RelWithDebInfo -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 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_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_REVISION }}/installed/x64-windows/lib/lua51.lib' -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_BENCHMARKS=ON
-D BUILD_COMPONENTS_TESTS=ON -D BUILD_COMPONENTS_TESTS=ON
-D BUILD_OPENMW_TESTS=ON -D BUILD_OPENMW_TESTS=ON
@ -171,9 +177,9 @@ jobs:
- name: Copy missing DLLs - name: Copy missing DLLs
run: | run: |
cp ${{ github.workspace }}/deps/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}/installed/x64-windows/bin/Release/MyGUIEngine.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_REVISION }}/installed/x64-windows/bin/osgPlugins-3.6.5 ${{ 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_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/*.dll ${{ github.workspace }}/install
- name: Copy Qt DLLs - name: Copy Qt DLLs
working-directory: ${{ github.workspace }}/deps/Qt/6.6.3/msvc2019_64 working-directory: ${{ github.workspace }}/deps/Qt/6.6.3/msvc2019_64
@ -212,20 +218,20 @@ jobs:
env: env:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}
run: | 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 printf "Ref ${{ github.ref }}\nJob ${job_url}\nCommit ${{ github.sha }}\n" > install/CI-ID.txt
cp install/CI-ID.txt pdb/CI-ID.txt cp install/CI-ID.txt pdb/CI-ID.txt
- name: Store OpenMW archived pdb files - name: Store OpenMW archived pdb files
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: openmw-${{ matrix.image }}-pdb-${{ github.sha }} name: openmw-windows-${{ matrix.image }}-pdb-${{ github.sha }}
path: ${{ github.workspace }}/pdb/* path: ${{ github.workspace }}/pdb/*
- name: Store OpenMW build artifacts - name: Store OpenMW build artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: openmw-${{ matrix.image }}-${{ github.sha }} name: openmw-windows-${{ matrix.image }}-${{ github.sha }}
path: ${{ github.workspace }}/install/* path: ${{ github.workspace }}/install/*
- name: Add install directory to PATH - name: Add install directory to PATH

@ -274,6 +274,20 @@ download() {
fi 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() { real_pwd() {
if type cygpath >/dev/null 2>&1; then if type cygpath >/dev/null 2>&1; then
cygpath -am "$PWD" cygpath -am "$PWD"
@ -532,11 +546,11 @@ fi
QT_VER='6.6.3' QT_VER='6.6.3'
AQT_VERSION='v3.1.15' AQT_VERSION='v3.1.15'
VCPKG_REVISION='65ef3a6db0e01983efc7d8286f44020beeee2ea3' VCPKG_TAG="2024-11-10"
VCPKG_PATH="vcpkg-x64-windows-${VS_VERSION:?}-${VCPKG_REVISION:?}" VCPKG_PATH="vcpkg-x64-${VS_VERSION:?}-${VCPKG_TAG:?}"
VCPKG_ARCHIVE="${VCPKG_PATH:?}.7z" VCPKG_PDB_PATH="vcpkg-x64-${VS_VERSION:?}-pdb-${VCPKG_TAG:?}"
VCPKG_PDB_PATH="vcpkg-x64-windows-${VS_VERSION:?}-pdb-${VCPKG_REVISION:?}" VCPKG_MANIFEST="${VCPKG_PATH:?}.txt"
VCPKG_PDB_ARCHIVE="${VCPKG_PDB_PATH:?}.7z" VCPKG_PDB_MANIFEST="${VCPKG_PDB_PATH:?}.txt"
echo echo
echo "===================================" echo "==================================="
@ -553,14 +567,16 @@ if [ -z $SKIP_DOWNLOAD ]; then
echo "Downloading dependency packages." echo "Downloading dependency packages."
echo echo
download "${VCPKG_PATH:?}" \ DEPS_BASE_URL="https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows"
"https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/${VCPKG_ARCHIVE:?}" \
"${VCPKG_ARCHIVE:?}"
if [ -n "${PDBS}" ]; then download "${VCPKG_MANIFEST:?}" \
"${DEPS_BASE_URL}/${VCPKG_MANIFEST:?}" \
"${VCPKG_MANIFEST:?}"
if [ -n "${VCPKG_PDB_MANIFEST:?}" ]; then
download "${VCPKG_PDB_PATH:?}" \ download "${VCPKG_PDB_PATH:?}" \
"https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/${VCPKG_PDB_ARCHIVE:?}" \ "${DEPS_BASE_URL}/${VCPKG_PDB_MANIFEST:?}" \
"${VCPKG_PDB_ARCHIVE:?}" "${VCPKG_PDB_MANIFEST:?}"
fi fi
fi fi
@ -599,15 +615,20 @@ echo
cd $DEPS cd $DEPS
echo echo
printf "vcpkg packages ${VCPKG_REVISION:?}... " printf "vcpkg packages ${VCPKG_TAG:?}... "
{ {
if [[ -d "${VCPKG_PATH:?}" ]]; then if [[ -d "${VCPKG_PATH:?}" ]]; then
printf "Exists. " printf "Exists. "
else else
eval 7z x -y -o"${VCPKG_PATH:?}" "${VCPKG_ARCHIVE:?}" ${STRIP} download_from_manifest "${VCPKG_MANIFEST:?}"
eval 7z x -y -o"${VCPKG_PATH:?}" "${MANIFEST_FILE:?}" ${STRIP}
fi
if [ -n "${PDBS}" ]; then if [ -n "${PDBS}" ]; then
eval 7z x -y -o"${VCPKG_PATH:?}" "${VCPKG_PDB_ARCHIVE:?}" ${STRIP} 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
fi fi

Loading…
Cancel
Save