mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-21 08:09:35 +08:00
9d2bb67834
PR #15819.
105 lines
3.0 KiB
YAML
105 lines
3.0 KiB
YAML
name: CI - macOS
|
|
on: [pull_request, push]
|
|
|
|
jobs:
|
|
ci:
|
|
name: Build
|
|
runs-on: macos-latest
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
libt_version: ["2.0.5", "1.2.15"]
|
|
qbt_gui: ["GUI=ON", "GUI=OFF"]
|
|
qt_version: ["5.15.2", "6.2.0"]
|
|
exclude:
|
|
- libt_version: "1.2.15"
|
|
qt_version: "6.2.0"
|
|
|
|
env:
|
|
openssl_root: /usr/local/opt/openssl@1.1
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
brew update > /dev/null
|
|
brew install \
|
|
cmake ninja \
|
|
boost openssl@1.1 zlib
|
|
|
|
- name: Setup ccache
|
|
uses: Chocobo1/setup-ccache-action@v1
|
|
with:
|
|
update_packager_index: false
|
|
|
|
- name: Install Qt
|
|
uses: jurplel/install-qt-action@v2
|
|
with:
|
|
version: ${{ matrix.qt_version }}
|
|
|
|
- name: Install libtorrent
|
|
run: |
|
|
git clone \
|
|
--branch v${{ matrix.libt_version }} \
|
|
--depth 1 \
|
|
--recurse-submodules \
|
|
https://github.com/arvidn/libtorrent.git
|
|
cd libtorrent
|
|
cmake \
|
|
-B build \
|
|
-G "Ninja" \
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
-DCMAKE_CXX_STANDARD=17 \
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
|
-Ddeprecated-functions=OFF \
|
|
-DOPENSSL_ROOT_DIR="${{ env.openssl_root }}"
|
|
cmake --build build
|
|
sudo cmake --install build
|
|
|
|
- name: Build qBittorrent (Qt5)
|
|
if: ${{ startsWith(matrix.qt_version, 5) }}
|
|
run: |
|
|
lupdate -extensions c,cpp,h,hpp,ui ./
|
|
cmake \
|
|
-B build \
|
|
-G "Ninja" \
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
|
-DOPENSSL_ROOT_DIR="${{ env.openssl_root }}" \
|
|
-DVERBOSE_CONFIGURE=ON \
|
|
-D${{ matrix.qbt_gui }}
|
|
cmake --build build
|
|
|
|
- name: Build qBittorrent (Qt6)
|
|
if: ${{ startsWith(matrix.qt_version, 6) }}
|
|
run: |
|
|
lupdate -extensions c,cpp,h,hpp,ui ./
|
|
cmake \
|
|
-B build \
|
|
-G "Ninja" \
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
|
-DOPENSSL_ROOT_DIR="${{ env.openssl_root }}" \
|
|
-DQT6=ON \
|
|
-DVERBOSE_CONFIGURE=ON \
|
|
-D${{ matrix.qbt_gui }}
|
|
cmake --build build
|
|
|
|
- name: Prepare build artifacts
|
|
run: |
|
|
mkdir upload
|
|
mv build/qbittorrent*.app upload
|
|
mkdir upload/cmake
|
|
cp build/compile_commands.json upload/cmake
|
|
mkdir upload/cmake/libtorrent
|
|
cp libtorrent/build/compile_commands.json upload/cmake/libtorrent
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: qBittorrent-CI_macOS_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}_Qt-${{ matrix.qt_version }}
|
|
path: upload
|