2021-08-19 03:21:34 +00:00
|
|
|
name: CI - Windows
|
2022-02-25 05:34:28 +00:00
|
|
|
|
2021-08-19 03:21:34 +00:00
|
|
|
on: [pull_request, push]
|
|
|
|
|
2023-02-16 08:16:54 +00:00
|
|
|
permissions:
|
|
|
|
actions: write
|
|
|
|
|
2022-02-25 05:34:28 +00:00
|
|
|
concurrency:
|
2022-03-02 05:26:13 +00:00
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
2022-02-25 05:34:28 +00:00
|
|
|
cancel-in-progress: ${{ github.head_ref != '' }}
|
|
|
|
|
2021-08-19 03:21:34 +00:00
|
|
|
jobs:
|
|
|
|
ci:
|
|
|
|
name: Build
|
2021-10-02 07:13:00 +00:00
|
|
|
runs-on: windows-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
2021-11-06 03:11:47 +00:00
|
|
|
matrix:
|
2023-05-24 02:10:57 +00:00
|
|
|
libt_version: ["2.0.9", "1.2.19"]
|
2021-10-02 07:13:00 +00:00
|
|
|
|
|
|
|
env:
|
2021-12-12 07:44:36 +00:00
|
|
|
boost_path: "${{ github.workspace }}/../boost"
|
2021-10-02 07:13:00 +00:00
|
|
|
libtorrent_path: "${{ github.workspace }}/libtorrent"
|
2021-08-19 03:21:34 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2023-09-05 11:42:07 +00:00
|
|
|
uses: actions/checkout@v4
|
2021-08-19 03:21:34 +00:00
|
|
|
|
2021-10-02 07:13:00 +00:00
|
|
|
- name: Setup devcmd
|
|
|
|
uses: ilammy/msvc-dev-cmd@v1
|
|
|
|
|
2021-08-19 03:21:34 +00:00
|
|
|
- name: Install build tools
|
|
|
|
run: |
|
|
|
|
choco install ninja
|
|
|
|
|
2021-08-22 04:29:17 +00:00
|
|
|
# use the preinstalled vcpkg from image
|
|
|
|
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md#package-management
|
2021-08-19 03:21:34 +00:00
|
|
|
- name: Setup vcpkg
|
2023-09-05 11:42:07 +00:00
|
|
|
uses: lukka/run-vcpkg@v11
|
2021-08-19 03:21:34 +00:00
|
|
|
with:
|
2021-08-22 04:29:17 +00:00
|
|
|
vcpkgDirectory: C:/vcpkg
|
|
|
|
doNotUpdateVcpkg: true # the preinstalled vcpkg is updated regularly
|
2021-08-19 03:21:34 +00:00
|
|
|
|
2021-11-17 04:34:12 +00:00
|
|
|
- name: Install dependencies from vcpkg
|
2021-08-19 03:21:34 +00:00
|
|
|
run: |
|
2021-11-17 04:34:12 +00:00
|
|
|
# clear buildtrees after each package installation to reduce disk space requirements
|
2021-08-19 03:21:34 +00:00
|
|
|
$packages = `
|
2021-10-02 07:13:00 +00:00
|
|
|
"openssl:x64-windows-static-release",
|
|
|
|
"zlib:x64-windows-static-release"
|
2021-08-19 03:21:34 +00:00
|
|
|
${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg.exe upgrade `
|
|
|
|
--no-dry-run
|
2021-08-22 04:29:17 +00:00
|
|
|
${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg.exe install `
|
|
|
|
--clean-after-build `
|
|
|
|
$packages
|
2021-08-19 03:21:34 +00:00
|
|
|
|
2021-10-02 07:13:00 +00:00
|
|
|
- name: Install boost
|
|
|
|
run: |
|
|
|
|
aria2c `
|
2023-08-15 11:04:44 +00:00
|
|
|
"https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.7z" `
|
2021-10-02 07:13:00 +00:00
|
|
|
-d "${{ runner.temp }}" `
|
|
|
|
-o "boost.7z"
|
|
|
|
7z x "${{ runner.temp }}/boost.7z" -o"${{ github.workspace }}/.."
|
|
|
|
move "${{ github.workspace }}/../boost_*" "${{ env.boost_path }}"
|
|
|
|
|
2021-11-17 04:34:12 +00:00
|
|
|
- name: Install Qt
|
2022-08-18 03:44:40 +00:00
|
|
|
uses: jurplel/install-qt-action@v3
|
2021-11-17 04:34:12 +00:00
|
|
|
with:
|
2023-07-27 14:45:26 +00:00
|
|
|
version: "6.5.2"
|
2022-10-01 13:54:15 +00:00
|
|
|
archives: qtbase qtsvg qttools
|
2021-11-17 04:34:12 +00:00
|
|
|
|
2021-10-02 07:13:00 +00:00
|
|
|
- name: Install libtorrent
|
|
|
|
run: |
|
2021-11-17 07:53:27 +00:00
|
|
|
git clone `
|
|
|
|
--branch v${{ matrix.libt_version }} `
|
|
|
|
--depth 1 `
|
|
|
|
--recurse-submodules `
|
|
|
|
https://github.com/arvidn/libtorrent.git
|
2021-10-02 07:13:00 +00:00
|
|
|
cd libtorrent
|
|
|
|
cmake `
|
|
|
|
-B build `
|
|
|
|
-G "Ninja" `
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
|
2022-01-14 06:43:22 +00:00
|
|
|
-DCMAKE_CXX_FLAGS=/guard:cf `
|
2021-11-06 03:11:47 +00:00
|
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON `
|
2021-10-02 07:13:00 +00:00
|
|
|
-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
|
2021-08-19 03:21:34 +00:00
|
|
|
|
|
|
|
- name: Build qBittorrent
|
|
|
|
run: |
|
2021-08-22 04:29:17 +00:00
|
|
|
cmake `
|
|
|
|
-B build `
|
|
|
|
-G "Ninja" `
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
|
2022-09-02 05:09:43 +00:00
|
|
|
-DCMAKE_CXX_FLAGS="/WX" `
|
2021-08-22 04:29:17 +00:00
|
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON `
|
|
|
|
-DCMAKE_TOOLCHAIN_FILE="${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" `
|
2021-10-02 07:13:00 +00:00
|
|
|
-DBOOST_ROOT="${{ env.boost_path }}" `
|
|
|
|
-DLibtorrentRasterbar_DIR="${{ env.libtorrent_path }}/lib/cmake/LibtorrentRasterbar" `
|
2021-08-22 04:29:17 +00:00
|
|
|
-DMSVC_RUNTIME_DYNAMIC=OFF `
|
2022-07-10 05:20:27 +00:00
|
|
|
-DTESTING=ON `
|
2021-08-22 04:29:17 +00:00
|
|
|
-DVCPKG_TARGET_TRIPLET=x64-windows-static-release `
|
|
|
|
-DVERBOSE_CONFIGURE=ON `
|
|
|
|
--graphviz=build/target_graph.dot
|
2022-05-28 22:08:51 +00:00
|
|
|
cmake --build build --target qbt_update_translations
|
2021-08-19 03:21:34 +00:00
|
|
|
cmake --build build
|
2022-07-10 05:20:27 +00:00
|
|
|
cmake --build build --target check
|
2021-08-19 03:21:34 +00:00
|
|
|
|
2021-10-02 07:13:00 +00:00
|
|
|
- name: Prepare build artifacts
|
|
|
|
run: |
|
|
|
|
mkdir upload
|
|
|
|
copy build/qbittorrent.exe upload
|
|
|
|
copy build/qbittorrent.pdb upload
|
|
|
|
copy dist/windows/qt.conf upload
|
2021-11-17 04:34:12 +00:00
|
|
|
# runtimes
|
2022-03-24 04:19:07 +00:00
|
|
|
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
|
2021-11-17 04:34:12 +00:00
|
|
|
mkdir upload/plugins/iconengines
|
2022-03-24 04:19:07 +00:00
|
|
|
copy "${{ env.Qt6_DIR }}/plugins/iconengines/qsvgicon.dll" upload/plugins/iconengines
|
2021-11-17 04:34:12 +00:00
|
|
|
mkdir upload/plugins/imageformats
|
2022-03-24 04:19:07 +00:00
|
|
|
copy "${{ env.Qt6_DIR }}/plugins/imageformats/qico.dll" upload/plugins/imageformats
|
|
|
|
copy "${{ env.Qt6_DIR }}/plugins/imageformats/qsvg.dll" upload/plugins/imageformats
|
2021-11-17 04:34:12 +00:00
|
|
|
mkdir upload/plugins/platforms
|
2022-03-24 04:19:07 +00:00
|
|
|
copy "${{ env.Qt6_DIR }}/plugins/platforms/qwindows.dll" upload/plugins/platforms
|
2021-11-17 04:34:12 +00:00
|
|
|
mkdir upload/plugins/sqldrivers
|
2022-03-24 04:19:07 +00:00
|
|
|
copy "${{ env.Qt6_DIR }}/plugins/sqldrivers/qsqlite.dll" upload/plugins/sqldrivers
|
2021-11-17 04:34:12 +00:00
|
|
|
mkdir upload/plugins/styles
|
2022-03-24 04:19:07 +00:00
|
|
|
copy "${{ env.Qt6_DIR }}/plugins/styles/qwindowsvistastyle.dll" upload/plugins/styles
|
2023-04-02 05:30:26 +00:00
|
|
|
mkdir upload/plugins/tls
|
|
|
|
copy "${{ env.Qt6_DIR }}/plugins/tls/qschannelbackend.dll" upload/plugins/tls
|
2021-11-17 04:34:12 +00:00
|
|
|
# cmake additionals
|
2021-10-02 07:13:00 +00:00
|
|
|
mkdir upload/cmake
|
|
|
|
copy build/compile_commands.json upload/cmake
|
|
|
|
copy build/target_graph.dot upload/cmake
|
2021-11-06 03:11:47 +00:00
|
|
|
mkdir upload/cmake/libtorrent
|
|
|
|
copy libtorrent/build/compile_commands.json upload/cmake/libtorrent
|
2021-10-02 07:13:00 +00:00
|
|
|
|
2021-08-19 03:21:34 +00:00
|
|
|
- name: Upload build artifacts
|
2022-03-04 23:13:36 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-08-19 03:21:34 +00:00
|
|
|
with:
|
2021-10-02 07:13:00 +00:00
|
|
|
name: qBittorrent-CI_Windows-x64_libtorrent-${{ matrix.libt_version }}
|
|
|
|
path: upload
|