Bump to 4.4.0beta3
[qBittorrent.git] / .github / workflows / ci_windows.yaml
blob37e68342b5a8962bd4c220250f3c7a404ad80875
1 name: CI - Windows
2 on: [pull_request, push]
4 jobs:
5   ci:
6     name: Build
7     runs-on: windows-2019
9     steps:
10       - name: Checkout repository
11         uses: actions/checkout@v2
13       - name: Install build tools
14         run: |
15           choco install ninja
17       # use the preinstalled vcpkg from image
18       # https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md#package-management
19       - name: Setup vcpkg
20         uses: lukka/run-vcpkg@v7
21         with:
22           vcpkgDirectory: C:/vcpkg
23           doNotUpdateVcpkg: true  # the preinstalled vcpkg is updated regularly
24           setupOnly: true
26       # tell vcpkg to only build Release variants of the dependencies
27       - name: Configure vcpkg triplet overlay
28         run: |
29           New-Item `
30             -Path "${{ github.workspace }}" `
31             -Name "triplets_overlay" `
32             -ItemType Directory
33           Copy-Item `
34             "${{ env.RUNVCPKG_VCPKG_ROOT }}/triplets/x64-windows-static.cmake" `
35             "${{ github.workspace }}/triplets_overlay/x64-windows-static-release.cmake"
36           Add-Content `
37             "${{ github.workspace }}/triplets_overlay/x64-windows-static-release.cmake" `
38             -Value "set(VCPKG_BUILD_TYPE release)"
40       # clear buildtrees after each package installation to reduce disk space requirements
41       - name: Install dependencies
42         run: |
43           $packages = `
44             "boost-circular-buffer:x64-windows-static-release",
45             "libtorrent:x64-windows-static-release",
46             "qt5-base:x64-windows-static-release",
47             "qt5-svg:x64-windows-static-release",
48             "qt5-tools:x64-windows-static-release",
49             "qt5-winextras:x64-windows-static-release"
50           ${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg.exe upgrade `
51             --overlay-triplets="${{ github.workspace }}/triplets_overlay" `
52             --no-dry-run
53           ${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg.exe install `
54             --overlay-triplets="${{ github.workspace }}/triplets_overlay" `
55             --clean-after-build `
56             $packages
58       # this is necessary to correctly find and use cl.exe with the Ninja generator for now
59       - name: Setup devcmd
60         uses: ilammy/msvc-dev-cmd@v1
62       - name: Build qBittorrent
63         run: |
64           cmake `
65             -B build `
66             -G "Ninja" `
67             -DCMAKE_BUILD_TYPE=RelWithDebInfo `
68             -DCMAKE_EXPORT_COMPILE_COMMANDS=ON `
69             -DCMAKE_TOOLCHAIN_FILE="${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" `
70             -DMSVC_RUNTIME_DYNAMIC=OFF `
71             -DVCPKG_TARGET_TRIPLET=x64-windows-static-release `
72             -DVERBOSE_CONFIGURE=ON `
73             --graphviz=build/target_graph.dot
74           cmake --build build
76       - name: Upload build artifacts
77         uses: actions/upload-artifact@v2
78         with:
79           name: qBittorrent-CI_Windows-x64
80           path: |
81             build/compile_commands.json
82             build/qbittorrent.exe
83             build/qbittorrent.pdb
84             build/target_graph.dot
85             dist/windows/qt.conf