2021-08-19 06:21:34 +03:00
|
|
|
name: CI - Windows
|
2022-02-25 08:34:28 +03:00
|
|
|
|
2021-08-19 06:21:34 +03:00
|
|
|
on: [pull_request, push]
|
|
|
|
|
2022-02-25 08:34:28 +03:00
|
|
|
concurrency:
|
2022-03-02 08:26:13 +03:00
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
2022-02-25 08:34:28 +03:00
|
|
|
cancel-in-progress: ${{ github.head_ref != '' }}
|
|
|
|
|
2021-08-19 06:21:34 +03:00
|
|
|
jobs:
|
|
|
|
ci:
|
|
|
|
name: Build
|
2021-10-02 10:13:00 +03:00
|
|
|
runs-on: windows-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
2021-11-06 06:11:47 +03:00
|
|
|
matrix:
|
2022-04-19 05:32:56 +03:00
|
|
|
libt_version: ["2.0.6", "1.2.16"]
|
2021-10-02 10:13:00 +03:00
|
|
|
|
|
|
|
env:
|
2021-12-12 10:44:36 +03:00
|
|
|
boost_path: "${{ github.workspace }}/../boost"
|
2021-10-02 10:13:00 +03:00
|
|
|
libtorrent_path: "${{ github.workspace }}/libtorrent"
|
2021-08-19 06:21:34 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2022-03-02 22:39:35 +03:00
|
|
|
uses: actions/checkout@v3
|
2021-08-19 06:21:34 +03:00
|
|
|
|
2021-10-02 10:13:00 +03:00
|
|
|
- name: Setup devcmd
|
|
|
|
uses: ilammy/msvc-dev-cmd@v1
|
|
|
|
|
2021-08-19 06:21:34 +03:00
|
|
|
- name: Install build tools
|
|
|
|
run: |
|
|
|
|
choco install ninja
|
|
|
|
|
2021-08-22 07:29:17 +03: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 06:21:34 +03:00
|
|
|
- name: Setup vcpkg
|
2022-04-01 10:49:21 +03:00
|
|
|
uses: lukka/run-vcpkg@v10
|
2021-08-19 06:21:34 +03:00
|
|
|
with:
|
2021-08-22 07:29:17 +03:00
|
|
|
vcpkgDirectory: C:/vcpkg
|
|
|
|
doNotUpdateVcpkg: true # the preinstalled vcpkg is updated regularly
|
2021-08-19 06:21:34 +03:00
|
|
|
|
2021-11-17 07:34:12 +03:00
|
|
|
- name: Install dependencies from vcpkg
|
2021-08-19 06:21:34 +03:00
|
|
|
run: |
|
2021-11-17 07:34:12 +03:00
|
|
|
# tell vcpkg to only build Release variants of the dependencies
|
2021-08-19 06:21:34 +03:00
|
|
|
New-Item `
|
2021-08-22 07:29:17 +03:00
|
|
|
-Path "${{ github.workspace }}" `
|
2021-08-19 06:21:34 +03:00
|
|
|
-Name "triplets_overlay" `
|
|
|
|
-ItemType Directory
|
|
|
|
Copy-Item `
|
2021-08-22 07:29:17 +03:00
|
|
|
"${{ env.RUNVCPKG_VCPKG_ROOT }}/triplets/x64-windows-static.cmake" `
|
|
|
|
"${{ github.workspace }}/triplets_overlay/x64-windows-static-release.cmake"
|
2021-08-19 06:21:34 +03:00
|
|
|
Add-Content `
|
2021-08-22 07:29:17 +03:00
|
|
|
"${{ github.workspace }}/triplets_overlay/x64-windows-static-release.cmake" `
|
2021-08-19 06:21:34 +03:00
|
|
|
-Value "set(VCPKG_BUILD_TYPE release)"
|
2021-11-17 07:34:12 +03:00
|
|
|
# clear buildtrees after each package installation to reduce disk space requirements
|
2021-08-19 06:21:34 +03:00
|
|
|
$packages = `
|
2021-10-02 10:13:00 +03:00
|
|
|
"openssl:x64-windows-static-release",
|
|
|
|
"zlib:x64-windows-static-release"
|
2021-08-19 06:21:34 +03:00
|
|
|
${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg.exe upgrade `
|
2021-08-22 07:29:17 +03:00
|
|
|
--overlay-triplets="${{ github.workspace }}/triplets_overlay" `
|
2021-08-19 06:21:34 +03:00
|
|
|
--no-dry-run
|
2021-08-22 07:29:17 +03:00
|
|
|
${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg.exe install `
|
|
|
|
--overlay-triplets="${{ github.workspace }}/triplets_overlay" `
|
|
|
|
--clean-after-build `
|
|
|
|
$packages
|
2021-08-19 06:21:34 +03:00
|
|
|
|
2021-10-02 10:13:00 +03:00
|
|
|
- name: Install boost
|
|
|
|
run: |
|
|
|
|
aria2c `
|
2022-04-19 05:32:56 +03:00
|
|
|
"https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.7z" `
|
2021-10-02 10:13:00 +03: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 07:34:12 +03:00
|
|
|
- name: Install Qt
|
|
|
|
uses: jurplel/install-qt-action@v2
|
|
|
|
with:
|
2022-04-19 05:32:56 +03:00
|
|
|
aqtversion: '==2.1.0'
|
|
|
|
version: "6.3.0"
|
2021-11-17 07:34:12 +03:00
|
|
|
|
2021-10-02 10:13:00 +03:00
|
|
|
- name: Install libtorrent
|
|
|
|
run: |
|
2021-11-17 10:53:27 +03:00
|
|
|
git clone `
|
|
|
|
--branch v${{ matrix.libt_version }} `
|
|
|
|
--depth 1 `
|
|
|
|
--recurse-submodules `
|
|
|
|
https://github.com/arvidn/libtorrent.git
|
2021-10-02 10:13:00 +03:00
|
|
|
cd libtorrent
|
|
|
|
cmake `
|
|
|
|
-B build `
|
|
|
|
-G "Ninja" `
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
|
2022-01-14 09:43:22 +03:00
|
|
|
-DCMAKE_CXX_FLAGS=/guard:cf `
|
2021-11-06 06:11:47 +03:00
|
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON `
|
2021-10-02 10:13:00 +03: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 06:21:34 +03:00
|
|
|
|
|
|
|
- name: Build qBittorrent
|
|
|
|
run: |
|
2021-12-07 07:17:15 +03:00
|
|
|
lupdate -extensions c,cpp,h,hpp,ui .
|
2021-08-22 07:29:17 +03:00
|
|
|
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" `
|
2021-10-02 10:13:00 +03:00
|
|
|
-DBOOST_ROOT="${{ env.boost_path }}" `
|
|
|
|
-DLibtorrentRasterbar_DIR="${{ env.libtorrent_path }}/lib/cmake/LibtorrentRasterbar" `
|
2021-08-22 07:29:17 +03:00
|
|
|
-DMSVC_RUNTIME_DYNAMIC=OFF `
|
2022-03-24 07:19:07 +03:00
|
|
|
-DQT6=ON `
|
2021-08-22 07:29:17 +03:00
|
|
|
-DVCPKG_TARGET_TRIPLET=x64-windows-static-release `
|
|
|
|
-DVERBOSE_CONFIGURE=ON `
|
|
|
|
--graphviz=build/target_graph.dot
|
2021-08-19 06:21:34 +03:00
|
|
|
cmake --build build
|
|
|
|
|
2021-10-02 10:13:00 +03: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 07:34:12 +03:00
|
|
|
# runtimes
|
2022-03-24 07:19:07 +03: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 07:34:12 +03:00
|
|
|
mkdir upload/plugins/iconengines
|
2022-03-24 07:19:07 +03:00
|
|
|
copy "${{ env.Qt6_DIR }}/plugins/iconengines/qsvgicon.dll" upload/plugins/iconengines
|
2021-11-17 07:34:12 +03:00
|
|
|
mkdir upload/plugins/imageformats
|
2022-03-24 07:19:07 +03: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 07:34:12 +03:00
|
|
|
mkdir upload/plugins/platforms
|
2022-03-24 07:19:07 +03:00
|
|
|
copy "${{ env.Qt6_DIR }}/plugins/platforms/qwindows.dll" upload/plugins/platforms
|
2021-11-17 07:34:12 +03:00
|
|
|
mkdir upload/plugins/sqldrivers
|
2022-03-24 07:19:07 +03:00
|
|
|
copy "${{ env.Qt6_DIR }}/plugins/sqldrivers/qsqlite.dll" upload/plugins/sqldrivers
|
2021-11-17 07:34:12 +03:00
|
|
|
mkdir upload/plugins/styles
|
2022-03-24 07:19:07 +03:00
|
|
|
copy "${{ env.Qt6_DIR }}/plugins/styles/qwindowsvistastyle.dll" upload/plugins/styles
|
2021-11-17 07:34:12 +03:00
|
|
|
# cmake additionals
|
2021-10-02 10:13:00 +03:00
|
|
|
mkdir upload/cmake
|
|
|
|
copy build/compile_commands.json upload/cmake
|
|
|
|
copy build/target_graph.dot upload/cmake
|
2021-11-06 06:11:47 +03:00
|
|
|
mkdir upload/cmake/libtorrent
|
|
|
|
copy libtorrent/build/compile_commands.json upload/cmake/libtorrent
|
2021-10-02 10:13:00 +03:00
|
|
|
|
2021-08-19 06:21:34 +03:00
|
|
|
- name: Upload build artifacts
|
2022-03-05 02:13:36 +03:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-08-19 06:21:34 +03:00
|
|
|
with:
|
2021-10-02 10:13:00 +03:00
|
|
|
name: qBittorrent-CI_Windows-x64_libtorrent-${{ matrix.libt_version }}
|
|
|
|
path: upload
|