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.9", "1.2.19"]
21 qbt_gui: ["GUI=ON", "GUI=OFF"]
25 boost_path: "${{ github.workspace }}/../boost"
26 openssl_root: /usr/local/opt/openssl@3
27 libtorrent_path: "${{ github.workspace }}/../libtorrent"
30 - name: Checkout repository
31 uses: actions/checkout@v4
33 - name: Install dependencies
34 uses: Wandalen/wretry.action@v1
36 HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
37 HOMEBREW_NO_INSTALL_CLEANUP: 1
42 brew update > /dev/null
48 uses: Chocobo1/setup-ccache-action@v1
50 store_cache: ${{ startsWith(github.ref, 'refs/heads/') }}
51 update_packager_index: false
55 BOOST_MAJOR_VERSION: "1"
56 BOOST_MINOR_VERSION: "84"
57 BOOST_PATCH_VERSION: "0"
59 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"
60 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"
62 curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url"
63 tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?"
64 if [ "$_exitCode" -ne "0" ]; then
65 curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url2"
66 tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?"
68 mv "${{ github.workspace }}/.."/boost_* "${{ env.boost_path }}"
71 uses: jurplel/install-qt-action@v3
73 version: ${{ matrix.qt_version }}
74 archives: qtbase qtdeclarative qtsvg qttools
75 # Not sure why Qt made a hard dependency on qtdeclarative, try removing it when Qt > 6.4.0
78 - name: Install libtorrent
81 --branch v${{ matrix.libt_version }} \
83 --recurse-submodules \
84 https://github.com/arvidn/libtorrent.git \
85 ${{ env.libtorrent_path }}
86 cd ${{ env.libtorrent_path }}
90 -DBUILD_SHARED_LIBS=OFF \
91 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
92 -DCMAKE_CXX_STANDARD=17 \
93 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
94 -DBOOST_ROOT="${{ env.boost_path }}" \
95 -Ddeprecated-functions=OFF \
96 -DOPENSSL_ROOT_DIR="${{ env.openssl_root }}"
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 }}" \
110 -DOPENSSL_ROOT_DIR="${{ env.openssl_root }}" \
112 -DVERBOSE_CONFIGURE=ON \
113 -D${{ matrix.qbt_gui }}
114 cmake --build build --target qbt_update_translations
116 cmake --build build --target check
118 - name: Prepare build artifacts
121 appName="qbittorrent"
122 if [ "${{ matrix.qbt_gui }}" = "GUI=OFF" ]; then
123 appName="qbittorrent-nox"
126 macdeployqt "$appName.app" -dmg -no-strip
128 # prepare upload folder
130 cp "build/$appName.dmg" upload
132 cp build/compile_commands.json upload/cmake
133 mkdir upload/cmake/libtorrent
134 cp ${{ env.libtorrent_path }}/build/compile_commands.json upload/cmake/libtorrent
136 - name: Upload build artifacts
137 uses: actions/upload-artifact@v4
139 name: qBittorrent-CI_macOS_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}_Qt-${{ matrix.qt_version }}