3 on: [pull_request, push]
9 group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
10 cancel-in-progress: ${{ github.head_ref != '' }}
20 libt_version: ["2.0.10", "1.2.19"]
21 qbt_gui: ["GUI=ON", "GUI=OFF"]
25 boost_path: "${{ github.workspace }}/../boost"
26 libtorrent_path: "${{ github.workspace }}/../libtorrent"
29 - name: Checkout repository
30 uses: actions/checkout@v4
32 - name: Install dependencies
33 uses: Wandalen/wretry.action@v3
35 HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
36 HOMEBREW_NO_INSTALL_CLEANUP: 1
41 brew update > /dev/null
47 uses: Chocobo1/setup-ccache-action@v1
49 store_cache: ${{ github.ref == 'refs/heads/master' }}
50 update_packager_index: false
56 BOOST_MAJOR_VERSION: "1"
57 BOOST_MINOR_VERSION: "86"
58 BOOST_PATCH_VERSION: "0"
60 boost_url="https://boostorg.jfrog.io/artifactory/main/release/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/source/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
61 boost_url2="https://sourceforge.net/projects/boost/files/boost/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
63 curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url"
64 tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?"
65 if [ "$_exitCode" -ne "0" ]; then
66 curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url2"
67 tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?"
69 mv "${{ github.workspace }}/.."/boost_* "${{ env.boost_path }}"
72 uses: jurplel/install-qt-action@v4
74 version: ${{ matrix.qt_version }}
75 archives: qtbase qtdeclarative qtsvg qttools
76 # Not sure why Qt made a hard dependency on qtdeclarative, try removing it when Qt > 6.4.0
79 - name: Install libtorrent
82 --branch v${{ matrix.libt_version }} \
84 --recurse-submodules \
85 https://github.com/arvidn/libtorrent.git \
86 ${{ env.libtorrent_path }}
87 cd ${{ env.libtorrent_path }}
91 -DBUILD_SHARED_LIBS=OFF \
92 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
93 -DCMAKE_CXX_STANDARD=17 \
94 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
95 -DBOOST_ROOT="${{ env.boost_path }}" \
96 -Ddeprecated-functions=OFF
98 sudo cmake --install build
100 - name: Build qBittorrent
102 CXXFLAGS="$CXXFLAGS -Werror -Wno-error=deprecated-declarations" \
103 LDFLAGS="$LDFLAGS -gz" \
107 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
108 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
109 -DBOOST_ROOT="${{ env.boost_path }}" \
111 -DVERBOSE_CONFIGURE=ON \
112 -D${{ matrix.qbt_gui }}
113 cmake --build build --target qbt_update_translations
115 cmake --build build --target check
117 - name: Prepare build artifacts
120 appName="qbittorrent"
121 if [ "${{ matrix.qbt_gui }}" = "GUI=OFF" ]; then
122 appName="qbittorrent-nox"
127 while [ "$PACKAGE_RETRY" -lt "3" ]; do
128 macdeployqt "$appName.app" -dmg -no-strip
129 if [ -f "$appName.dmg" ]; then
133 PACKAGE_RETRY=$((PACKAGE_RETRY + 1))
134 echo "Retry $PACKAGE_RETRY..."
137 # prepare upload folder
139 cp "build/$appName.dmg" upload
141 cp build/compile_commands.json upload/cmake
142 mkdir upload/cmake/libtorrent
143 cp ${{ env.libtorrent_path }}/build/compile_commands.json upload/cmake/libtorrent
145 - name: Upload build artifacts
146 uses: actions/upload-artifact@v4
148 name: qBittorrent-CI_macOS_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}_Qt-${{ matrix.qt_version }}