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