Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to downloading dependencies from Github releases #3236

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 25 additions & 19 deletions .github/workflows/openmw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

env:
BUILD_TYPE: RelWithDebInfo
VCPKG_DEPS_REVISION: 65ef3a6db0e01983efc7d8286f44020beeee2ea3
VCPKG_DEPS_TAG: 2024-11-10

jobs:
Ubuntu:
Expand Down Expand Up @@ -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
Expand All @@ -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 }} ${{ archive }}

- name: Cache Qt
id: qt-cache
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
53 changes: 37 additions & 16 deletions CI/before_script.msvc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:?}" | shasum -a 512 --check
MANIFEST_FILE="${FILE:?}"
}

real_pwd() {
if type cygpath >/dev/null 2>&1; then
cygpath -am "$PWD"
Expand Down Expand Up @@ -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 "==================================="
Expand All @@ -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

Expand Down Expand Up @@ -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

Expand Down