2021-08-19 11:21:34 +08:00
|
|
|
name: CI - Ubuntu
|
2022-02-25 13:34:28 +08:00
|
|
|
|
2021-08-19 11:21:34 +08:00
|
|
|
on: [pull_request, push]
|
|
|
|
|
2023-02-16 16:16:54 +08:00
|
|
|
permissions:
|
|
|
|
actions: write
|
|
|
|
|
2022-02-25 13:34:28 +08:00
|
|
|
concurrency:
|
2022-03-02 13:26:13 +08:00
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
2022-02-25 13:34:28 +08:00
|
|
|
cancel-in-progress: ${{ github.head_ref != '' }}
|
|
|
|
|
2021-08-19 11:21:34 +08:00
|
|
|
jobs:
|
|
|
|
ci:
|
|
|
|
name: Build
|
2022-08-10 21:47:33 +08:00
|
|
|
runs-on: ubuntu-latest
|
2021-08-19 11:21:34 +08:00
|
|
|
|
|
|
|
strategy:
|
2021-10-24 00:57:50 +08:00
|
|
|
fail-fast: false
|
2021-08-19 11:21:34 +08:00
|
|
|
matrix:
|
2022-10-25 12:44:57 +08:00
|
|
|
libt_version: ["2.0.8", "1.2.18"]
|
2021-08-19 11:21:34 +08:00
|
|
|
qbt_gui: ["GUI=ON", "GUI=OFF"]
|
2021-10-24 00:57:50 +08:00
|
|
|
qt_version: ["5.15.2", "6.2.0"]
|
|
|
|
exclude:
|
2022-10-25 12:44:57 +08:00
|
|
|
- libt_version: "1.2.18"
|
2021-10-24 00:57:50 +08:00
|
|
|
qt_version: "6.2.0"
|
2021-08-19 11:21:34 +08:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2022-03-03 03:39:35 +08:00
|
|
|
uses: actions/checkout@v3
|
2021-08-19 11:21:34 +08:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install \
|
2021-09-23 12:38:52 +08:00
|
|
|
build-essential cmake ninja-build pkg-config \
|
2021-10-24 00:57:50 +08:00
|
|
|
libboost-dev libssl-dev zlib1g-dev
|
2021-08-19 11:21:34 +08:00
|
|
|
|
2021-09-23 12:38:52 +08:00
|
|
|
- name: Setup ccache
|
|
|
|
uses: Chocobo1/setup-ccache-action@v1
|
|
|
|
with:
|
|
|
|
update_packager_index: false
|
2021-10-03 16:09:09 +08:00
|
|
|
ccache_options: |
|
|
|
|
max_size=2G
|
2021-08-19 11:21:34 +08:00
|
|
|
|
2021-10-24 00:57:50 +08:00
|
|
|
- name: Install Qt
|
2022-08-18 11:44:40 +08:00
|
|
|
uses: jurplel/install-qt-action@v3
|
2021-10-24 00:57:50 +08:00
|
|
|
with:
|
|
|
|
version: ${{ matrix.qt_version }}
|
2022-10-01 21:54:15 +08:00
|
|
|
archives: icu qtbase qtsvg qttools
|
2021-10-24 00:57:50 +08:00
|
|
|
|
2021-08-19 11:21:34 +08:00
|
|
|
- name: Install libtorrent
|
|
|
|
run: |
|
2021-11-17 15:53:27 +08:00
|
|
|
git clone \
|
|
|
|
--branch v${{ matrix.libt_version }} \
|
|
|
|
--depth 1 \
|
|
|
|
--recurse-submodules \
|
|
|
|
https://github.com/arvidn/libtorrent.git
|
2021-08-19 11:21:34 +08:00
|
|
|
cd libtorrent
|
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-G "Ninja" \
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
2021-11-06 11:11:47 +08:00
|
|
|
-Ddeprecated-functions=OFF
|
2021-08-19 11:21:34 +08:00
|
|
|
cmake --build build
|
|
|
|
sudo cmake --install build
|
|
|
|
|
2021-10-24 00:57:50 +08:00
|
|
|
- name: Build qBittorrent (Qt5)
|
|
|
|
if: ${{ startsWith(matrix.qt_version, 5) }}
|
|
|
|
run: |
|
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-G "Ninja" \
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
2022-09-02 13:09:43 +08:00
|
|
|
-DCMAKE_CXX_FLAGS="-Werror -Wno-error=deprecated-declarations" \
|
2021-10-24 00:57:50 +08:00
|
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
2021-11-06 11:11:47 +08:00
|
|
|
-DCMAKE_INSTALL_PREFIX="/usr" \
|
2022-07-10 13:20:27 +08:00
|
|
|
-DTESTING=ON \
|
2021-10-24 00:57:50 +08:00
|
|
|
-DVERBOSE_CONFIGURE=ON \
|
2021-11-06 11:11:47 +08:00
|
|
|
-D${{ matrix.qbt_gui }}
|
2022-05-29 06:08:51 +08:00
|
|
|
cmake --build build --target qbt_update_translations
|
2021-10-24 00:57:50 +08:00
|
|
|
cmake --build build
|
2022-07-10 13:20:27 +08:00
|
|
|
cmake --build build --target check
|
2023-02-16 16:20:05 +08:00
|
|
|
DESTDIR="qbittorrent" cmake --install build
|
2021-10-24 00:57:50 +08:00
|
|
|
|
|
|
|
- name: Build qBittorrent (Qt6)
|
|
|
|
if: ${{ startsWith(matrix.qt_version, 6) }}
|
2021-08-19 11:21:34 +08:00
|
|
|
run: |
|
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-G "Ninja" \
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
2022-09-02 13:09:43 +08:00
|
|
|
-DCMAKE_CXX_FLAGS="-Werror" \
|
2021-08-19 11:21:34 +08:00
|
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
2021-11-06 11:11:47 +08:00
|
|
|
-DCMAKE_INSTALL_PREFIX="/usr" \
|
2021-10-24 00:57:50 +08:00
|
|
|
-DQT6=ON \
|
2022-07-10 13:20:27 +08:00
|
|
|
-DTESTING=ON \
|
2021-08-19 11:21:34 +08:00
|
|
|
-DVERBOSE_CONFIGURE=ON \
|
2021-11-06 11:11:47 +08:00
|
|
|
-D${{ matrix.qbt_gui }}
|
2022-05-29 06:08:51 +08:00
|
|
|
cmake --build build --target qbt_update_translations
|
2021-08-19 11:21:34 +08:00
|
|
|
cmake --build build
|
2022-07-10 13:20:27 +08:00
|
|
|
cmake --build build --target check
|
2023-02-16 16:20:05 +08:00
|
|
|
DESTDIR="qbittorrent" cmake --install build
|
2021-11-06 11:11:47 +08:00
|
|
|
|
|
|
|
- name: Prepare build artifacts
|
|
|
|
run: |
|
|
|
|
mkdir upload
|
|
|
|
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 11:21:34 +08:00
|
|
|
|
2022-12-10 23:12:00 +08:00
|
|
|
- name: 'AppImage: Prepare env'
|
|
|
|
run: |
|
|
|
|
sudo apt install libfuse2
|
|
|
|
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
|
|
|
wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
|
|
|
|
wget https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage
|
|
|
|
chmod +x linuxdeploy-x86_64.AppImage
|
|
|
|
chmod +x linuxdeploy-plugin-qt-x86_64.AppImage
|
|
|
|
chmod +x linuxdeploy-plugin-appimage-x86_64.AppImage
|
|
|
|
|
|
|
|
- name: 'AppImage: Prepare nox'
|
|
|
|
if: matrix.qbt_gui == 'GUI=OFF'
|
|
|
|
run: |
|
|
|
|
mkdir -p qbittorrent/usr/share/icons/hicolor/scalable/apps/
|
|
|
|
mkdir -p qbittorrent/usr/share/applications/
|
|
|
|
cp dist/unix/menuicons/scalable/apps/qbittorrent.svg qbittorrent/usr/share/icons/hicolor/scalable/apps/qbittorrent.svg
|
|
|
|
cp .github/workflows/helper/appimage/org.qbittorrent.qBittorrent.desktop qbittorrent/usr/share/applications/org.qbittorrent.qBittorrent.desktop
|
|
|
|
|
|
|
|
- name: 'AppImage: Package'
|
|
|
|
run: |
|
|
|
|
./linuxdeploy-x86_64.AppImage --appdir=qbittorrent --plugin qt
|
|
|
|
rm qbittorrent/apprun-hooks/*
|
|
|
|
cp .github/workflows/helper/appimage/export_vars.sh qbittorrent/apprun-hooks/export_vars.sh
|
|
|
|
NO_APPSTREAM=1 \
|
|
|
|
OUTPUT=upload/qbittorrent-CI_Ubuntu_x86_64.AppImage \
|
|
|
|
./linuxdeploy-x86_64.AppImage --appdir=qbittorrent --output appimage
|
|
|
|
|
2021-08-19 11:21:34 +08:00
|
|
|
- name: Upload build artifacts
|
2022-03-05 07:13:36 +08:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-08-19 11:21:34 +08:00
|
|
|
with:
|
2022-12-10 23:12:00 +08:00
|
|
|
name: qBittorrent-CI_Ubuntu-x64_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}_Qt-${{ matrix.qt_version }}
|
2021-11-06 11:11:47 +08:00
|
|
|
path: upload
|