2021-08-19 03:21:34 +00:00
|
|
|
name: CI - macOS
|
2022-02-25 05:34:28 +00:00
|
|
|
|
2021-08-19 03:21:34 +00:00
|
|
|
on: [pull_request, push]
|
|
|
|
|
2023-02-16 08:16:54 +00:00
|
|
|
permissions:
|
|
|
|
actions: write
|
|
|
|
|
2022-02-25 05:34:28 +00:00
|
|
|
concurrency:
|
2022-03-02 05:26:13 +00:00
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
2022-02-25 05:34:28 +00:00
|
|
|
cancel-in-progress: ${{ github.head_ref != '' }}
|
|
|
|
|
2021-08-19 03:21:34 +00:00
|
|
|
jobs:
|
|
|
|
ci:
|
|
|
|
name: Build
|
2021-10-22 04:16:11 +00:00
|
|
|
runs-on: macos-latest
|
2021-08-19 03:21:34 +00:00
|
|
|
|
|
|
|
strategy:
|
2021-10-23 16:57:50 +00:00
|
|
|
fail-fast: false
|
2021-08-19 03:21:34 +00:00
|
|
|
matrix:
|
2023-05-24 02:10:57 +00:00
|
|
|
libt_version: ["2.0.9", "1.2.19"]
|
2021-08-19 03:21:34 +00:00
|
|
|
qbt_gui: ["GUI=ON", "GUI=OFF"]
|
2023-04-24 05:15:46 +00:00
|
|
|
qt_version: ["5.15.2", "6.5.0"]
|
2021-10-23 16:57:50 +00:00
|
|
|
exclude:
|
2023-05-24 02:10:57 +00:00
|
|
|
- libt_version: "1.2.19"
|
2023-04-24 05:15:46 +00:00
|
|
|
qt_version: "6.5.0"
|
2021-08-19 03:21:34 +00:00
|
|
|
|
|
|
|
env:
|
2022-02-26 06:17:38 +00:00
|
|
|
boost_path: "${{ github.workspace }}/../boost"
|
2021-08-19 03:21:34 +00:00
|
|
|
openssl_root: /usr/local/opt/openssl@1.1
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2022-03-02 19:39:35 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-08-19 03:21:34 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2023-02-16 08:10:08 +00:00
|
|
|
export \
|
|
|
|
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 \
|
|
|
|
HOMEBREW_NO_INSTALL_CLEANUP=1
|
2021-08-19 03:21:34 +00:00
|
|
|
brew update > /dev/null
|
|
|
|
brew install \
|
|
|
|
cmake ninja \
|
2022-02-26 06:17:38 +00:00
|
|
|
openssl@1.1 zlib
|
2021-08-19 03:21:34 +00:00
|
|
|
|
2021-09-23 04:38:52 +00:00
|
|
|
- name: Setup ccache
|
|
|
|
uses: Chocobo1/setup-ccache-action@v1
|
|
|
|
with:
|
|
|
|
update_packager_index: false
|
|
|
|
|
2022-02-26 06:17:38 +00:00
|
|
|
- name: Install boost
|
|
|
|
run: |
|
|
|
|
curl \
|
|
|
|
-L \
|
|
|
|
-o "${{ runner.temp }}/boost.tar.bz2" \
|
2023-04-24 05:15:46 +00:00
|
|
|
"https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_1_82_0.tar.bz2"
|
2022-02-26 06:17:38 +00:00
|
|
|
tar -xf "${{ runner.temp }}/boost.tar.bz2" -C "${{ github.workspace }}/.."
|
|
|
|
mv "${{ github.workspace }}/.."/boost_* "${{ env.boost_path }}"
|
|
|
|
|
2021-10-23 16:57:50 +00:00
|
|
|
- name: Install Qt
|
2022-08-18 03:44:40 +00:00
|
|
|
uses: jurplel/install-qt-action@v3
|
2021-10-23 16:57:50 +00:00
|
|
|
with:
|
|
|
|
version: ${{ matrix.qt_version }}
|
2022-10-01 13:54:15 +00:00
|
|
|
archives: qtbase qtdeclarative qtsvg qttools
|
|
|
|
# Not sure why Qt made a hard dependency on qtdeclarative, try removing it when Qt > 6.4.0
|
2021-10-23 16:57:50 +00:00
|
|
|
|
2021-08-19 03:21:34 +00:00
|
|
|
- name: Install libtorrent
|
|
|
|
run: |
|
2021-11-17 07:53:27 +00:00
|
|
|
git clone \
|
|
|
|
--branch v${{ matrix.libt_version }} \
|
|
|
|
--depth 1 \
|
|
|
|
--recurse-submodules \
|
|
|
|
https://github.com/arvidn/libtorrent.git
|
2021-08-19 03:21:34 +00:00
|
|
|
cd libtorrent
|
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-G "Ninja" \
|
2023-05-29 04:24:12 +00:00
|
|
|
-DBUILD_SHARED_LIBS=OFF \
|
2021-08-19 03:21:34 +00:00
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
-DCMAKE_CXX_STANDARD=17 \
|
2021-11-06 03:11:47 +00:00
|
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
2022-02-26 06:17:38 +00:00
|
|
|
-DBOOST_ROOT="${{ env.boost_path }}" \
|
2021-08-19 03:21:34 +00:00
|
|
|
-Ddeprecated-functions=OFF \
|
|
|
|
-DOPENSSL_ROOT_DIR="${{ env.openssl_root }}"
|
|
|
|
cmake --build build
|
|
|
|
sudo cmake --install build
|
|
|
|
|
2021-10-23 16:57:50 +00:00
|
|
|
- name: Build qBittorrent (Qt5)
|
2023-03-11 20:58:04 +00:00
|
|
|
if: startsWith(matrix.qt_version, 5)
|
2021-08-19 03:21:34 +00:00
|
|
|
run: |
|
2023-02-16 08:26:38 +00:00
|
|
|
CXXFLAGS="$CXXFLAGS -Werror -Wno-error=deprecated-declarations" \
|
2023-02-16 08:31:48 +00:00
|
|
|
LDFLAGS="$LDFLAGS -gz" \
|
2021-08-19 03:21:34 +00:00
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-G "Ninja" \
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
2021-11-06 03:11:47 +00:00
|
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
2022-02-26 06:17:38 +00:00
|
|
|
-DBOOST_ROOT="${{ env.boost_path }}" \
|
2021-10-23 16:57:50 +00:00
|
|
|
-DOPENSSL_ROOT_DIR="${{ env.openssl_root }}" \
|
2022-07-10 05:20:27 +00:00
|
|
|
-DTESTING=ON \
|
2021-08-19 03:21:34 +00:00
|
|
|
-DVERBOSE_CONFIGURE=ON \
|
2021-10-23 16:57:50 +00:00
|
|
|
-D${{ matrix.qbt_gui }}
|
2022-05-28 22:08:51 +00:00
|
|
|
cmake --build build --target qbt_update_translations
|
2021-10-23 16:57:50 +00:00
|
|
|
cmake --build build
|
2022-07-10 05:20:27 +00:00
|
|
|
cmake --build build --target check
|
2021-10-23 16:57:50 +00:00
|
|
|
|
|
|
|
- name: Build qBittorrent (Qt6)
|
2023-03-11 20:58:04 +00:00
|
|
|
if: startsWith(matrix.qt_version, 6)
|
2021-10-23 16:57:50 +00:00
|
|
|
run: |
|
2023-02-16 08:26:38 +00:00
|
|
|
CXXFLAGS="$CXXFLAGS -Wno-gnu-zero-variadic-macro-arguments -Werror -Wno-error=deprecated-declarations" \
|
2023-02-16 08:31:48 +00:00
|
|
|
LDFLAGS="$LDFLAGS -gz" \
|
2021-10-23 16:57:50 +00:00
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-G "Ninja" \
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
2021-11-06 03:11:47 +00:00
|
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
2022-02-26 06:17:38 +00:00
|
|
|
-DBOOST_ROOT="${{ env.boost_path }}" \
|
2021-10-23 16:57:50 +00:00
|
|
|
-DOPENSSL_ROOT_DIR="${{ env.openssl_root }}" \
|
|
|
|
-DQT6=ON \
|
2022-07-10 05:20:27 +00:00
|
|
|
-DTESTING=ON \
|
2021-10-23 16:57:50 +00:00
|
|
|
-DVERBOSE_CONFIGURE=ON \
|
|
|
|
-D${{ matrix.qbt_gui }}
|
2022-05-28 22:08:51 +00:00
|
|
|
cmake --build build --target qbt_update_translations
|
2021-08-19 03:21:34 +00:00
|
|
|
cmake --build build
|
2022-07-10 05:20:27 +00:00
|
|
|
cmake --build build --target check
|
2021-08-19 03:21:34 +00:00
|
|
|
|
2021-11-06 03:11:47 +00:00
|
|
|
- name: Prepare build artifacts
|
|
|
|
run: |
|
2023-05-29 04:24:12 +00: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 03:11:47 +00:00
|
|
|
mkdir upload
|
2023-05-29 04:24:12 +00:00
|
|
|
cp "build/$appName.dmg" upload
|
2021-11-06 03:11:47 +00:00
|
|
|
mkdir upload/cmake
|
|
|
|
cp build/compile_commands.json upload/cmake
|
|
|
|
mkdir upload/cmake/libtorrent
|
|
|
|
cp libtorrent/build/compile_commands.json upload/cmake/libtorrent
|
|
|
|
|
2021-08-19 03:21:34 +00:00
|
|
|
- name: Upload build artifacts
|
2022-03-04 23:13:36 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-08-19 03:21:34 +00:00
|
|
|
with:
|
2023-05-29 04:24:12 +00:00
|
|
|
name: qBittorrent-CI_macOS_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}_Qt-${{ matrix.qt_version }}
|
2021-11-06 03:11:47 +00:00
|
|
|
path: upload
|