2021-08-19 06:21:34 +03:00
|
|
|
name: CI - macOS
|
2022-02-25 08:34:28 +03:00
|
|
|
|
2021-08-19 06:21:34 +03:00
|
|
|
on: [pull_request, push]
|
|
|
|
|
2023-02-16 11:16:54 +03:00
|
|
|
permissions:
|
|
|
|
actions: write
|
|
|
|
|
2022-02-25 08:34:28 +03:00
|
|
|
concurrency:
|
2022-03-02 08:26:13 +03:00
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
2022-02-25 08:34:28 +03:00
|
|
|
cancel-in-progress: ${{ github.head_ref != '' }}
|
|
|
|
|
2021-08-19 06:21:34 +03:00
|
|
|
jobs:
|
|
|
|
ci:
|
|
|
|
name: Build
|
2021-10-22 07:16:11 +03:00
|
|
|
runs-on: macos-latest
|
2021-08-19 06:21:34 +03:00
|
|
|
|
|
|
|
strategy:
|
2021-10-23 19:57:50 +03:00
|
|
|
fail-fast: false
|
2021-08-19 06:21:34 +03:00
|
|
|
matrix:
|
2023-05-24 05:10:57 +03:00
|
|
|
libt_version: ["2.0.9", "1.2.19"]
|
2021-08-19 06:21:34 +03:00
|
|
|
qbt_gui: ["GUI=ON", "GUI=OFF"]
|
2023-07-27 17:45:26 +03:00
|
|
|
qt_version: ["6.5.2"]
|
2021-08-19 06:21:34 +03:00
|
|
|
|
|
|
|
env:
|
2022-02-26 09:17:38 +03:00
|
|
|
boost_path: "${{ github.workspace }}/../boost"
|
2023-09-26 06:51:53 +03:00
|
|
|
openssl_root: /usr/local/opt/openssl@3
|
2023-11-30 11:48:25 +03:00
|
|
|
libtorrent_path: "${{ github.workspace }}/../libtorrent"
|
2021-08-19 06:21:34 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2023-09-05 14:42:07 +03:00
|
|
|
uses: actions/checkout@v4
|
2021-08-19 06:21:34 +03:00
|
|
|
|
|
|
|
- name: Install dependencies
|
2023-07-03 16:19:01 +03:00
|
|
|
uses: Wandalen/wretry.action@v1
|
2023-07-13 08:26:47 +03:00
|
|
|
env:
|
|
|
|
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
|
|
|
|
HOMEBREW_NO_INSTALL_CLEANUP: 1
|
2023-07-03 16:19:01 +03:00
|
|
|
with:
|
|
|
|
attempt_delay: 20000
|
|
|
|
attempt_limit: 6
|
|
|
|
command: |
|
|
|
|
brew update > /dev/null
|
|
|
|
brew install \
|
|
|
|
cmake ninja \
|
2023-09-26 06:51:53 +03:00
|
|
|
openssl@3 zlib
|
2021-08-19 06:21:34 +03:00
|
|
|
|
2021-09-23 07:38:52 +03:00
|
|
|
- name: Setup ccache
|
|
|
|
uses: Chocobo1/setup-ccache-action@v1
|
|
|
|
with:
|
2023-11-18 09:58:51 +03:00
|
|
|
store_cache: ${{ startsWith(github.ref, 'refs/heads/') }}
|
2021-09-23 07:38:52 +03:00
|
|
|
update_packager_index: false
|
|
|
|
|
2022-02-26 09:17:38 +03:00
|
|
|
- name: Install boost
|
|
|
|
run: |
|
2024-01-02 10:54:49 +03:00
|
|
|
boost_url="https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.gz"
|
|
|
|
boost_url2="https://sourceforge.net/projects/boost/files/boost/1.83.0/boost_1_83_0.tar.gz"
|
|
|
|
set +e
|
|
|
|
curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url"
|
|
|
|
tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?"
|
|
|
|
if [ "$_exitCode" -ne "0" ]; then
|
|
|
|
curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url2"
|
|
|
|
tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?"
|
|
|
|
fi
|
2022-02-26 09:17:38 +03:00
|
|
|
mv "${{ github.workspace }}/.."/boost_* "${{ env.boost_path }}"
|
|
|
|
|
2021-10-23 19:57:50 +03:00
|
|
|
- name: Install Qt
|
2022-08-18 06:44:40 +03:00
|
|
|
uses: jurplel/install-qt-action@v3
|
2021-10-23 19:57:50 +03:00
|
|
|
with:
|
|
|
|
version: ${{ matrix.qt_version }}
|
2022-10-01 16:54:15 +03:00
|
|
|
archives: qtbase qtdeclarative qtsvg qttools
|
|
|
|
# Not sure why Qt made a hard dependency on qtdeclarative, try removing it when Qt > 6.4.0
|
2023-11-17 17:32:33 +03:00
|
|
|
cache: true
|
2021-10-23 19:57:50 +03:00
|
|
|
|
2021-08-19 06:21:34 +03:00
|
|
|
- name: Install libtorrent
|
|
|
|
run: |
|
2021-11-17 10:53:27 +03:00
|
|
|
git clone \
|
|
|
|
--branch v${{ matrix.libt_version }} \
|
|
|
|
--depth 1 \
|
|
|
|
--recurse-submodules \
|
2023-11-30 11:48:25 +03:00
|
|
|
https://github.com/arvidn/libtorrent.git \
|
|
|
|
${{ env.libtorrent_path }}
|
|
|
|
cd ${{ env.libtorrent_path }}
|
2021-08-19 06:21:34 +03:00
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-G "Ninja" \
|
2023-05-29 07:24:12 +03:00
|
|
|
-DBUILD_SHARED_LIBS=OFF \
|
2021-08-19 06:21:34 +03:00
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
-DCMAKE_CXX_STANDARD=17 \
|
2021-11-06 06:11:47 +03:00
|
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
2022-02-26 09:17:38 +03:00
|
|
|
-DBOOST_ROOT="${{ env.boost_path }}" \
|
2021-08-19 06:21:34 +03:00
|
|
|
-Ddeprecated-functions=OFF \
|
|
|
|
-DOPENSSL_ROOT_DIR="${{ env.openssl_root }}"
|
|
|
|
cmake --build build
|
|
|
|
sudo cmake --install build
|
|
|
|
|
2023-08-08 18:46:30 +03:00
|
|
|
- name: Build qBittorrent
|
2021-10-23 19:57:50 +03:00
|
|
|
run: |
|
2023-09-18 19:25:02 +03:00
|
|
|
CXXFLAGS="$CXXFLAGS -Werror -Wno-error=deprecated-declarations" \
|
2023-02-16 11:31:48 +03:00
|
|
|
LDFLAGS="$LDFLAGS -gz" \
|
2021-10-23 19:57:50 +03:00
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-G "Ninja" \
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
2021-11-06 06:11:47 +03:00
|
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
2022-02-26 09:17:38 +03:00
|
|
|
-DBOOST_ROOT="${{ env.boost_path }}" \
|
2021-10-23 19:57:50 +03:00
|
|
|
-DOPENSSL_ROOT_DIR="${{ env.openssl_root }}" \
|
2022-07-10 08:20:27 +03:00
|
|
|
-DTESTING=ON \
|
2021-10-23 19:57:50 +03:00
|
|
|
-DVERBOSE_CONFIGURE=ON \
|
|
|
|
-D${{ matrix.qbt_gui }}
|
2022-05-29 01:08:51 +03:00
|
|
|
cmake --build build --target qbt_update_translations
|
2021-08-19 06:21:34 +03:00
|
|
|
cmake --build build
|
2022-07-10 08:20:27 +03:00
|
|
|
cmake --build build --target check
|
2021-08-19 06:21:34 +03:00
|
|
|
|
2021-11-06 06:11:47 +03:00
|
|
|
- name: Prepare build artifacts
|
|
|
|
run: |
|
2023-05-29 07:24:12 +03:00
|
|
|
# create .dmg
|
|
|
|
appName="qbittorrent"
|
|
|
|
if [ "${{ matrix.qbt_gui }}" = "GUI=OFF" ]; then
|
|
|
|
appName="qbittorrent-nox"
|
|
|
|
fi
|
|
|
|
pushd build
|
|
|
|
macdeployqt "$appName.app" -dmg -no-strip
|
|
|
|
popd
|
|
|
|
# prepare upload folder
|
2021-11-06 06:11:47 +03:00
|
|
|
mkdir upload
|
2023-05-29 07:24:12 +03:00
|
|
|
cp "build/$appName.dmg" upload
|
2021-11-06 06:11:47 +03:00
|
|
|
mkdir upload/cmake
|
|
|
|
cp build/compile_commands.json upload/cmake
|
|
|
|
mkdir upload/cmake/libtorrent
|
2023-11-30 11:48:25 +03:00
|
|
|
cp ${{ env.libtorrent_path }}/build/compile_commands.json upload/cmake/libtorrent
|
2021-11-06 06:11:47 +03:00
|
|
|
|
2021-08-19 06:21:34 +03:00
|
|
|
- name: Upload build artifacts
|
2024-01-02 11:23:09 +03:00
|
|
|
uses: actions/upload-artifact@v4
|
2021-08-19 06:21:34 +03:00
|
|
|
with:
|
2023-05-29 07:24:12 +03:00
|
|
|
name: qBittorrent-CI_macOS_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}_Qt-${{ matrix.qt_version }}
|
2021-11-06 06:11:47 +03:00
|
|
|
path: upload
|