3 on: [pull_request, push]
9 group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
10 cancel-in-progress: ${{ github.head_ref != '' }}
15 runs-on: windows-latest
20 libt_version: ["2.0.9", "1.2.19"]
23 boost_path: "${{ github.workspace }}/../boost"
24 libtorrent_path: "${{ github.workspace }}/libtorrent"
27 - name: Checkout repository
28 uses: actions/checkout@v4
31 uses: ilammy/msvc-dev-cmd@v1
33 - name: Install build tools
37 # use the preinstalled vcpkg from image
38 # https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md#package-management
40 uses: lukka/run-vcpkg@v11
42 vcpkgDirectory: C:/vcpkg
43 doNotUpdateVcpkg: true # the preinstalled vcpkg is updated regularly
45 - name: Install dependencies from vcpkg
47 # clear buildtrees after each package installation to reduce disk space requirements
49 "openssl:x64-windows-static-release",
50 "zlib:x64-windows-static-release"
51 ${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg.exe upgrade `
53 ${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg.exe install `
60 "https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.7z" `
61 -d "${{ runner.temp }}" `
63 7z x "${{ runner.temp }}/boost.7z" -o"${{ github.workspace }}/.."
64 move "${{ github.workspace }}/../boost_*" "${{ env.boost_path }}"
67 uses: jurplel/install-qt-action@v3
70 archives: qtbase qtsvg qttools
72 - name: Install libtorrent
75 --branch v${{ matrix.libt_version }} `
77 --recurse-submodules `
78 https://github.com/arvidn/libtorrent.git
83 -DCMAKE_BUILD_TYPE=RelWithDebInfo `
84 -DCMAKE_CXX_FLAGS=/guard:cf `
85 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON `
86 -DCMAKE_INSTALL_PREFIX="${{ env.libtorrent_path }}" `
87 -DCMAKE_TOOLCHAIN_FILE="${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" `
88 -DBOOST_ROOT="${{ env.boost_path }}" `
89 -DBUILD_SHARED_LIBS=OFF `
90 -Ddeprecated-functions=OFF `
91 -Dstatic_runtime=OFF `
92 -DVCPKG_TARGET_TRIPLET=x64-windows-static-release
96 - name: Build qBittorrent
101 -DCMAKE_BUILD_TYPE=RelWithDebInfo `
102 -DCMAKE_CXX_FLAGS="/WX" `
103 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON `
104 -DCMAKE_TOOLCHAIN_FILE="${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" `
105 -DBOOST_ROOT="${{ env.boost_path }}" `
106 -DLibtorrentRasterbar_DIR="${{ env.libtorrent_path }}/lib/cmake/LibtorrentRasterbar" `
107 -DMSVC_RUNTIME_DYNAMIC=ON `
109 -DVCPKG_TARGET_TRIPLET=x64-windows-static-release `
110 -DVERBOSE_CONFIGURE=ON `
111 --graphviz=build/target_graph.dot
112 cmake --build build --target qbt_update_translations
114 cmake --build build --target check
116 - name: Prepare build artifacts
119 copy build/qbittorrent.exe upload
120 copy build/qbittorrent.pdb upload
121 copy dist/windows/qt.conf upload
123 copy "${{ env.Qt6_DIR }}/bin/Qt6Core.dll" upload
124 copy "${{ env.Qt6_DIR }}/bin/Qt6Gui.dll" upload
125 copy "${{ env.Qt6_DIR }}/bin/Qt6Network.dll" upload
126 copy "${{ env.Qt6_DIR }}/bin/Qt6Sql.dll" upload
127 copy "${{ env.Qt6_DIR }}/bin/Qt6Svg.dll" upload
128 copy "${{ env.Qt6_DIR }}/bin/Qt6Widgets.dll" upload
129 copy "${{ env.Qt6_DIR }}/bin/Qt6Xml.dll" upload
130 mkdir upload/plugins/iconengines
131 copy "${{ env.Qt6_DIR }}/plugins/iconengines/qsvgicon.dll" upload/plugins/iconengines
132 mkdir upload/plugins/imageformats
133 copy "${{ env.Qt6_DIR }}/plugins/imageformats/qico.dll" upload/plugins/imageformats
134 copy "${{ env.Qt6_DIR }}/plugins/imageformats/qsvg.dll" upload/plugins/imageformats
135 mkdir upload/plugins/platforms
136 copy "${{ env.Qt6_DIR }}/plugins/platforms/qwindows.dll" upload/plugins/platforms
137 mkdir upload/plugins/sqldrivers
138 copy "${{ env.Qt6_DIR }}/plugins/sqldrivers/qsqlite.dll" upload/plugins/sqldrivers
139 mkdir upload/plugins/styles
140 copy "${{ env.Qt6_DIR }}/plugins/styles/qwindowsvistastyle.dll" upload/plugins/styles
141 mkdir upload/plugins/tls
142 copy "${{ env.Qt6_DIR }}/plugins/tls/qschannelbackend.dll" upload/plugins/tls
145 copy build/compile_commands.json upload/cmake
146 copy build/target_graph.dot upload/cmake
147 mkdir upload/cmake/libtorrent
148 copy libtorrent/build/compile_commands.json upload/cmake/libtorrent
150 - name: Upload build artifacts
151 uses: actions/upload-artifact@v3
153 name: qBittorrent-CI_Windows-x64_libtorrent-${{ matrix.libt_version }}