mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-24 02:06:07 +03:00
b740cc23d3
Update `libtorrent` version(s) to `2.0.6` & `1.2.16` in `GHA CI` - https://github.com/arvidn/libtorrent/releases/tag/v2.0.6 - https://github.com/arvidn/libtorrent/releases/tag/v1.2.16 Update `Boost` version to `1.79.0` - https://www.boost.org/users/history/version_1_79_0.html Bump `pre-commit-hooks` version to `4.2.0` - https://github.com/pre-commit/pre-commit-hooks/releases/tag/v4.2.0 Update `Qt6` version to `6.3.0` - https://www.qt.io/blog/qt-6.3-released - https://code.qt.io/cgit/qt/qtreleasenotes.git/about/qt/6.3.0/release-note.md Note: used `aqtinstall 2.1.0` with `jurplel/install-qt-action` for support of `Qt 6.2.1+` (this requirement can be removed on official release of `jurplel/install-qt-action v3`) PR #16888.
160 lines
6.2 KiB
YAML
160 lines
6.2 KiB
YAML
name: CI - Windows
|
|
|
|
on: [pull_request, push]
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: ${{ github.head_ref != '' }}
|
|
|
|
jobs:
|
|
ci:
|
|
name: Build
|
|
runs-on: windows-latest
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
libt_version: ["2.0.6", "1.2.16"]
|
|
|
|
env:
|
|
boost_path: "${{ github.workspace }}/../boost"
|
|
libtorrent_path: "${{ github.workspace }}/libtorrent"
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup devcmd
|
|
uses: ilammy/msvc-dev-cmd@v1
|
|
|
|
- name: Install build tools
|
|
run: |
|
|
choco install ninja
|
|
|
|
# use the preinstalled vcpkg from image
|
|
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md#package-management
|
|
- name: Setup vcpkg
|
|
uses: lukka/run-vcpkg@v10
|
|
with:
|
|
vcpkgDirectory: C:/vcpkg
|
|
doNotUpdateVcpkg: true # the preinstalled vcpkg is updated regularly
|
|
|
|
- name: Install dependencies from vcpkg
|
|
run: |
|
|
# tell vcpkg to only build Release variants of the dependencies
|
|
New-Item `
|
|
-Path "${{ github.workspace }}" `
|
|
-Name "triplets_overlay" `
|
|
-ItemType Directory
|
|
Copy-Item `
|
|
"${{ env.RUNVCPKG_VCPKG_ROOT }}/triplets/x64-windows-static.cmake" `
|
|
"${{ github.workspace }}/triplets_overlay/x64-windows-static-release.cmake"
|
|
Add-Content `
|
|
"${{ github.workspace }}/triplets_overlay/x64-windows-static-release.cmake" `
|
|
-Value "set(VCPKG_BUILD_TYPE release)"
|
|
# clear buildtrees after each package installation to reduce disk space requirements
|
|
$packages = `
|
|
"openssl:x64-windows-static-release",
|
|
"zlib:x64-windows-static-release"
|
|
${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg.exe upgrade `
|
|
--overlay-triplets="${{ github.workspace }}/triplets_overlay" `
|
|
--no-dry-run
|
|
${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg.exe install `
|
|
--overlay-triplets="${{ github.workspace }}/triplets_overlay" `
|
|
--clean-after-build `
|
|
$packages
|
|
|
|
- name: Install boost
|
|
run: |
|
|
aria2c `
|
|
"https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.7z" `
|
|
-d "${{ runner.temp }}" `
|
|
-o "boost.7z"
|
|
7z x "${{ runner.temp }}/boost.7z" -o"${{ github.workspace }}/.."
|
|
move "${{ github.workspace }}/../boost_*" "${{ env.boost_path }}"
|
|
|
|
- name: Install Qt
|
|
uses: jurplel/install-qt-action@v2
|
|
with:
|
|
aqtversion: '==2.1.0'
|
|
version: "6.3.0"
|
|
|
|
- name: Install libtorrent
|
|
run: |
|
|
git clone `
|
|
--branch v${{ matrix.libt_version }} `
|
|
--depth 1 `
|
|
--recurse-submodules `
|
|
https://github.com/arvidn/libtorrent.git
|
|
cd libtorrent
|
|
cmake `
|
|
-B build `
|
|
-G "Ninja" `
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
|
|
-DCMAKE_CXX_FLAGS=/guard:cf `
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON `
|
|
-DCMAKE_INSTALL_PREFIX="${{ env.libtorrent_path }}" `
|
|
-DCMAKE_TOOLCHAIN_FILE="${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" `
|
|
-DBOOST_ROOT="${{ env.boost_path }}" `
|
|
-DBUILD_SHARED_LIBS=OFF `
|
|
-Ddeprecated-functions=OFF `
|
|
-Dstatic_runtime=ON `
|
|
-DVCPKG_TARGET_TRIPLET=x64-windows-static-release
|
|
cmake --build build
|
|
cmake --install build
|
|
|
|
- name: Build qBittorrent
|
|
run: |
|
|
lupdate -extensions c,cpp,h,hpp,ui .
|
|
cmake `
|
|
-B build `
|
|
-G "Ninja" `
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON `
|
|
-DCMAKE_TOOLCHAIN_FILE="${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" `
|
|
-DBOOST_ROOT="${{ env.boost_path }}" `
|
|
-DLibtorrentRasterbar_DIR="${{ env.libtorrent_path }}/lib/cmake/LibtorrentRasterbar" `
|
|
-DMSVC_RUNTIME_DYNAMIC=OFF `
|
|
-DQT6=ON `
|
|
-DVCPKG_TARGET_TRIPLET=x64-windows-static-release `
|
|
-DVERBOSE_CONFIGURE=ON `
|
|
--graphviz=build/target_graph.dot
|
|
cmake --build build
|
|
|
|
- name: Prepare build artifacts
|
|
run: |
|
|
mkdir upload
|
|
copy build/qbittorrent.exe upload
|
|
copy build/qbittorrent.pdb upload
|
|
copy dist/windows/qt.conf upload
|
|
# runtimes
|
|
copy "${{ env.Qt6_DIR }}/bin/Qt6Core.dll" upload
|
|
copy "${{ env.Qt6_DIR }}/bin/Qt6Gui.dll" upload
|
|
copy "${{ env.Qt6_DIR }}/bin/Qt6Network.dll" upload
|
|
copy "${{ env.Qt6_DIR }}/bin/Qt6Sql.dll" upload
|
|
copy "${{ env.Qt6_DIR }}/bin/Qt6Svg.dll" upload
|
|
copy "${{ env.Qt6_DIR }}/bin/Qt6Widgets.dll" upload
|
|
copy "${{ env.Qt6_DIR }}/bin/Qt6Xml.dll" upload
|
|
mkdir upload/plugins/iconengines
|
|
copy "${{ env.Qt6_DIR }}/plugins/iconengines/qsvgicon.dll" upload/plugins/iconengines
|
|
mkdir upload/plugins/imageformats
|
|
copy "${{ env.Qt6_DIR }}/plugins/imageformats/qico.dll" upload/plugins/imageformats
|
|
copy "${{ env.Qt6_DIR }}/plugins/imageformats/qsvg.dll" upload/plugins/imageformats
|
|
mkdir upload/plugins/platforms
|
|
copy "${{ env.Qt6_DIR }}/plugins/platforms/qwindows.dll" upload/plugins/platforms
|
|
mkdir upload/plugins/sqldrivers
|
|
copy "${{ env.Qt6_DIR }}/plugins/sqldrivers/qsqlite.dll" upload/plugins/sqldrivers
|
|
mkdir upload/plugins/styles
|
|
copy "${{ env.Qt6_DIR }}/plugins/styles/qwindowsvistastyle.dll" upload/plugins/styles
|
|
# cmake additionals
|
|
mkdir upload/cmake
|
|
copy build/compile_commands.json upload/cmake
|
|
copy build/target_graph.dot upload/cmake
|
|
mkdir upload/cmake/libtorrent
|
|
copy libtorrent/build/compile_commands.json upload/cmake/libtorrent
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: qBittorrent-CI_Windows-x64_libtorrent-${{ matrix.libt_version }}
|
|
path: upload
|