Skip to content

Don't treat in-game downloads as official plugins #3067

Don't treat in-game downloads as official plugins

Don't treat in-game downloads as official plugins #3067

Workflow file for this run

name: CI
on:
push:
# Don't run this workflow when a tag is pushed.
branches:
- '*'
pull_request:
env:
AQTINSTALL_VERSION: 3.3.0
BOOST_VERSION: 1.87.0
LIBLOOT_VERSION: 0.28.2
OGDF_VERSION: foxglove-202510
QT_VERSION: 6.9.1
UV_VERSION: 0.8.20
permissions:
contents: read
jobs:
# Check if the template.pot file is up to date. Run this as a separate job
# so that an outdated POT file causes a visible error but does not block the
# main CI builds.
check-pot:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Install gettext
run: |
sudo apt-get update
sudo apt-get install -y --no-upgrade gettext
- name: Print xgettext version
run: xgettext --version
- name: Run pre-commit hook script
run: ./scripts/git/hooks/pre-commit
- name: Check if any changes were staged
run: |
if [[ $(git status --porcelain) ]]
then
echo "::warning ::The generated resources/l10n/template.pot does not match the committed file, which may be outdated and/or was generated by a different version of gettext."
git --no-pager diff HEAD
fi
linux:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: pip cache
uses: actions/cache@v5
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-aqtinstall-${{ env.AQTINSTALL_VERSION }}
- name: Get Boost metadata
id: boost-metadata
run: |
BOOST_ROOT=~/boost_${BOOST_VERSION//./_}
echo "root=$BOOST_ROOT" >> $GITHUB_OUTPUT
- name: Set libloot install path
run: echo "LIBLOOT_INSTALL_PATH=${{ github.workspace }}/libloot-${{ env.LIBLOOT_VERSION }}-install" >> $GITHUB_ENV
- name: Boost cache
id: boost-cache
uses: actions/cache@v5
with:
path: |
${{ steps.boost-metadata.outputs.root }}/boost
${{ steps.boost-metadata.outputs.root }}/stage
key: ${{ runner.os }}-Boost-${{ env.BOOST_VERSION }}
- name: libloot cache
id: libloot-cache
uses: actions/cache@v5
with:
path: ${{ env.LIBLOOT_INSTALL_PATH }}
key: ${{ runner.os }}-libloot-${{ env.LIBLOOT_VERSION }}
- name: Install C++ dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-upgrade \
build-essential \
libgl1-mesa-dev \
libicu-dev \
libtbb-dev
- name: Download & build Boost
run: |
wget https://raw.githubusercontent.com/Ortham/ci-scripts/2.2.1/install_boost.py
sha256sum -c <<< 'a6e3f965d31cf45ff80a28d932b011359a45d7154398807e296a9e08f27e67e7 install_boost.py'
python install_boost.py --directory ~ --boost-version $BOOST_VERSION -a 64 locale
if: steps.boost-cache.outputs.cache-hit != 'true'
- name: Download Qt
id: qt-metadata
run: |
python -m pip install aqtinstall==${{ env.AQTINSTALL_VERSION }}
aqt install-qt linux desktop $QT_VERSION linux_gcc_64
echo "root=${{ github.workspace }}/$QT_VERSION/gcc_64" >> $GITHUB_OUTPUT
- name: Checkout libloot repository
uses: actions/checkout@v6
with:
repository: loot/libloot
ref: ${{ env.LIBLOOT_VERSION }}
path: libloot-${{ env.LIBLOOT_VERSION }}
if: steps.libloot-cache.outputs.cache-hit != 'true'
- name: Build libloot
run: |
LIBLOOT_BUILD_DIR="libloot-$LIBLOOT_VERSION/cpp/build"
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DLIBLOOT_BUILD_TESTS=OFF \
-DLIBLOOT_INSTALL_DOCS=OFF \
-DCMAKE_INSTALL_PREFIX="$LIBLOOT_INSTALL_PATH" \
-B "$LIBLOOT_BUILD_DIR" \
-S "libloot-$LIBLOOT_VERSION/cpp"
cmake --build "$LIBLOOT_BUILD_DIR" --target loot --config Release
cmake --install "$LIBLOOT_BUILD_DIR" --config Release
if: steps.libloot-cache.outputs.cache-hit != 'true'
- name: Run CMake
run: |
cmake \
-DQt6_ROOT="${{ steps.qt-metadata.outputs.root }}" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="${{ env.LIBLOOT_INSTALL_PATH }};${{ steps.boost-metadata.outputs.root }}/stage" \
-B build
cmake --build build --target loot_gui_tests
- name: Run tests
run: ctest --test-dir build --output-on-failure --parallel
flatpak:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install uv
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
with:
version: ${{ env.UV_VERSION }}
- name: flatpak-builder cache
uses: actions/cache@v5
with:
path: ${{ github.workspace }}/build/.flatpak-builder
key: ${{ runner.os }}-flatpak-builder-${{ hashFiles('resources/linux/io.github.loot.loot.yml') }}
- name: Get descriptive LOOT version
id: get-loot-version
shell: bash
run: |
GIT_DESCRIBE=$(git describe --tags --long --abbrev=7)
GIT_REF=${{ github.ref }}
GIT_REF_SUFFIX=${GIT_REF#refs/*/}
LOOT_DESC_REF=${GIT_DESCRIBE}_${GIT_REF_SUFFIX}
LOOT_SAFE_DESC_REF=${LOOT_DESC_REF//[\/<>\"|]/_}
echo "version=$LOOT_SAFE_DESC_REF" >> $GITHUB_OUTPUT
- name: Install Flatpak build dependencies
run: |
sudo add-apt-repository ppa:flatpak/stable
sudo apt-get update
sudo apt-get install -y --no-upgrade \
flatpak \
flatpak-builder
- name: Generate Flatpak dependency manifests
run: ./scripts/generate_manifests.sh
- name: Lint the AppStream MetaInfo
run: |
flatpak install flathub -y org.flatpak.Builder
flatpak run --command=flatpak-builder-lint org.flatpak.Builder \
manifest resources/linux/io.github.loot.loot.yml \
--exceptions
- name: Build Flatpak package
id: build-flatpak
run: |
PACKAGE_FILENAME=loot_${{ steps.get-loot-version.outputs.version }}.flatpak
./scripts/build_flatpak.sh "$PACKAGE_FILENAME"
echo "filename=$PACKAGE_FILENAME" >> $GITHUB_OUTPUT
- name: Lint the Flatpak package repo
run: |
flatpak run --command=flatpak-builder-lint org.flatpak.Builder \
repo build/flatpak-repo \
--exceptions \
--user-exceptions resources/linux/flatpak-builder-lint-exceptions.json
- name: Import GPG key
run: echo -n "${{ secrets.GPG_SIGNING_KEY }}" | gpg --import
if: github.event_name == 'push'
- name: Sign Flatpak package
run: gpg --output "build/${{ steps.build-flatpak.outputs.filename }}.sig" --detach-sig "build/${{ steps.build-flatpak.outputs.filename }}"
if: github.event_name == 'push'
- name: Upload Flatpak package
uses: actions/upload-artifact@v6
with:
name: ${{ steps.build-flatpak.outputs.filename }}
path: |
build/${{ steps.build-flatpak.outputs.filename }}
build/${{ steps.build-flatpak.outputs.filename }}.sig
if: github.event_name == 'push'
windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Install uv
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
with:
version: ${{ env.UV_VERSION }}
- name: Get Boost metadata
id: boost-metadata
run: |
$BOOST_ROOT="${{ github.workspace }}/boost_" + $env:BOOST_VERSION -replace "\.", "_"
echo "root=$BOOST_ROOT" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
- name: Set libloot install path
shell: bash
run: echo "LIBLOOT_INSTALL_PATH=${{ github.workspace }}/libloot-${{ env.LIBLOOT_VERSION }}-install" >> $GITHUB_ENV
- name: Set OGDF install path
shell: bash
run: echo "OGDF_INSTALL_PATH=${{ github.workspace }}/ogdf-${{ env.OGDF_VERSION }}-install" >> $GITHUB_ENV
- name: Boost cache
id: boost-cache
uses: actions/cache@v5
with:
path: |
${{ steps.boost-metadata.outputs.root }}/boost
${{ steps.boost-metadata.outputs.root }}/stage
key: ${{ runner.os }}-x64-Boost-${{ env.BOOST_VERSION }}
- name: libloot cache
id: libloot-cache
uses: actions/cache@v5
with:
path: ${{ env.LIBLOOT_INSTALL_PATH }}
key: ${{ runner.os }}-libloot-${{ env.LIBLOOT_VERSION }}
- name: OGDF cache
id: ogdf-cache
uses: actions/cache@v5
with:
path: ${{ env.OGDF_INSTALL_PATH }}
key: ${{ runner.os }}-x64-ogdf-${{ env.OGDF_VERSION }}
- name: Download and extract svg_to_ico
run: |
$filename = scripts\download_file.ps1 `
'https://github.com/Ortham/svg_to_ico/releases/download/1.1.0/svg_to_ico.7z' `
'b2a3e82591ad4834a253290a76f007e5bab35e5a97584d29b3a4b5d0ff9acef3'
7z e -y $filename
- name: Generate ICO file
run: .\svg_to_ico.exe -i resources\icons\loot.svg -o build\icon\icon.ico
- name: Download & build Boost
run: |
$filename = scripts\download_file.ps1 `
'https://raw.githubusercontent.com/Ortham/ci-scripts/2.2.1/install_boost.py' `
'a6e3f965d31cf45ff80a28d932b011359a45d7154398807e296a9e08f27e67e7'
python $filename --directory ${{ github.workspace }} --boost-version ${{ env.BOOST_VERSION }} -a 64 locale
if: steps.boost-cache.outputs.cache-hit != 'true'
- name: Download and build OGDF
run: |
$filename = scripts\download_file.ps1 `
"https://github.com/ogdf/ogdf/archive/refs/tags/${env:OGDF_VERSION}.zip" `
'76770ea566fdab4727b51534fefecd2ef4ebc947e03a7614e605be33624275bf'
Expand-Archive -Path "${env:OGDF_VERSION}.zip" -DestinationPath .
$OGDF_BUILD_DIR="ogdf-${env:OGDF_VERSION}/build"
cmake -G "Visual Studio 17 2022" `
-A x64 `
-DCMAKE_INSTALL_PREFIX="${env:OGDF_INSTALL_PATH}" `
-B $OGDF_BUILD_DIR `
-S "ogdf-${env:OGDF_VERSION}"
cmake --build $OGDF_BUILD_DIR --config Release
cmake --install $OGDF_BUILD_DIR --config Release
if: steps.ogdf-cache.outputs.cache-hit != 'true'
- name: Download Qt
id: qt-metadata
run: |
uv run --with aqtinstall==${{ env.AQTINSTALL_VERSION }} -- aqt install-qt windows desktop ${env:QT_VERSION} win64_msvc2022_64
echo "root=${{ github.workspace }}/${env:QT_VERSION}/msvc2022_64" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
- name: Checkout libloot repository
uses: actions/checkout@v6
with:
repository: loot/libloot
ref: ${{ env.LIBLOOT_VERSION }}
path: libloot-${{ env.LIBLOOT_VERSION }}
if: steps.libloot-cache.outputs.cache-hit != 'true'
- name: Download and build libloot
run: |
$LIBLOOT_BUILD_DIR="libloot-$env:LIBLOOT_VERSION/cpp/build"
cmake `
-DLIBLOOT_BUILD_TESTS=OFF `
-DLIBLOOT_INSTALL_DOCS=OFF `
-DCMAKE_INSTALL_PREFIX="$env:LIBLOOT_INSTALL_PATH" `
-B "$LIBLOOT_BUILD_DIR" `
-S "libloot-$env:LIBLOOT_VERSION/cpp"
cmake --build "$LIBLOOT_BUILD_DIR" --target loot --config Release
cmake --install "$LIBLOOT_BUILD_DIR" --config Release
if: steps.libloot-cache.outputs.cache-hit != 'true'
- name: Run CMake
run: |
cmake -G "Visual Studio 17 2022" `
-A x64 `
-DCMAKE_PREFIX_PATH="${{ env.LIBLOOT_INSTALL_PATH }};${{ steps.boost-metadata.outputs.root }}\stage" `
-DQt6_ROOT="${{ steps.qt-metadata.outputs.root }}" `
-DOGDF_ROOT="${{ env.OGDF_INSTALL_PATH }}" `
-B build
cmake --build build --config Release
- name: Run tests
run: ctest --test-dir build --output-on-failure --parallel --build-config Release
- name: Install packages for building docs
run: uv sync --locked --project docs
- name: Build docs
working-directory: docs
run: uv run --locked -- sphinx-build -b html . ..\build\docs\html
- name: Install Gettext
run: |
$filename = scripts\download_file.ps1 `
'https://github.com/vslavik/gettext-tools-windows/releases/download/v0.22.5/gettext-tools-windows-0.22.5.zip' `
'2a49b7c26e91c4f4f3d389067c3d6dda77aee816aee0f36e172d84577311b7da'
7z x -y -ogettext ".\$filename"
echo "$PWD/gettext/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Build translation message object files
run: python scripts/po_to_mo.py
- name: Get descriptive LOOT version
id: get-loot-version
shell: bash
run: |
GIT_DESCRIBE=$(git describe --tags --long --abbrev=7)
GIT_REF=${{ github.ref }}
GIT_REF_SUFFIX=${GIT_REF#refs/*/}
LOOT_DESC_REF=${GIT_DESCRIBE}_${GIT_REF_SUFFIX}
LOOT_SAFE_DESC_REF=${LOOT_DESC_REF//[\/<>\"|]/_}
SAFE_GIT_REF_SUFFIX=${GIT_REF_SUFFIX//[\/<>\"|]/_}
echo "version=$LOOT_SAFE_DESC_REF" >> $GITHUB_OUTPUT
echo "ref=$SAFE_GIT_REF_SUFFIX" >> $GITHUB_OUTPUT
- name: Get LOOT artifact basename
id: get-artifact-basename
shell: bash
run: |
VERSION="${{ steps.get-loot-version.outputs.version }}"
echo "basename=loot_${VERSION}-win64" >> $GITHUB_OUTPUT
- name: Import GPG key
run: echo -n "${{ secrets.GPG_SIGNING_KEY }}" | gpg --import
if: github.event_name == 'push'
- name: Build archive
run: |
$env:PATH="${{ steps.qt-metadata.outputs.root }}/bin;$env:PATH"
python scripts\archive.py . "${{ steps.get-loot-version.outputs.ref }}"
mv "build\loot_${{ steps.get-loot-version.outputs.version }}.7z" "build\${{ steps.get-artifact-basename.outputs.basename }}.7z"
- name: Sign archive
run: gpg --output "build/${{ steps.get-artifact-basename.outputs.basename }}.7z.sig" --detach-sig "build/${{ steps.get-artifact-basename.outputs.basename }}.7z"
if: github.event_name == 'push'
- name: Build installer
run: |
scripts\prepare_installer.ps1
$env:PATH += ';C:\Program Files (x86)\Inno Setup 6'
iscc scripts\installer.iss
mv "build\LOOT Installer.exe" "build\${{ steps.get-artifact-basename.outputs.basename }}.exe"
- name: Sign installer
run: gpg --output "build/${{ steps.get-artifact-basename.outputs.basename }}.exe.sig" --detach-sig "build/${{ steps.get-artifact-basename.outputs.basename }}.exe"
if: github.event_name == 'push'
- name: Upload archive
uses: actions/upload-artifact@v6
with:
name: ${{ steps.get-artifact-basename.outputs.basename }}.7z
path: |
build/${{ steps.get-artifact-basename.outputs.basename }}.7z
build/${{ steps.get-artifact-basename.outputs.basename }}.7z.sig
if: github.event_name == 'push'
- name: Upload installer
uses: actions/upload-artifact@v6
with:
name: ${{ steps.get-artifact-basename.outputs.basename }}.exe
path: |
build/${{ steps.get-artifact-basename.outputs.basename }}.exe
build/${{ steps.get-artifact-basename.outputs.basename }}.exe.sig
if: github.event_name == 'push'