mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-25 14:04:23 +00:00
GHA CI: Use prebuilt library packages on macOS
This commit is contained in:
parent
d0d0bed333
commit
c12e486f59
103
.github/workflows/ci.yaml
vendored
103
.github/workflows/ci.yaml
vendored
@ -16,8 +16,8 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
qbt_gui: ["GUI=ON", "GUI=OFF"]
|
|
||||||
libt_version: ["v2.0.4", "v1.2.14"]
|
libt_version: ["v2.0.4", "v1.2.14"]
|
||||||
|
qbt_gui: ["GUI=ON", "GUI=OFF"]
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -26,6 +26,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup ccache
|
- name: Setup ccache
|
||||||
uses: hendrikmuhs/ccache-action@v1
|
uses: hendrikmuhs/ccache-action@v1
|
||||||
|
with:
|
||||||
|
key: ${{ runner.os }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
@ -58,7 +60,7 @@ jobs:
|
|||||||
-Ddeprecated-functions=OFF \
|
-Ddeprecated-functions=OFF \
|
||||||
--graphviz=cmake-build-dir/target_graph.dot
|
--graphviz=cmake-build-dir/target_graph.dot
|
||||||
cmake --build build
|
cmake --build build
|
||||||
sudo cmake --install build --prefix /usr/local
|
sudo cmake --install build
|
||||||
|
|
||||||
- name: Build qBittorrent
|
- name: Build qBittorrent
|
||||||
run: |
|
run: |
|
||||||
@ -186,95 +188,66 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
libt_version: ["v2.0.4", "v1.2.14"]
|
||||||
qbt_gui: ["GUI=ON", "GUI=OFF"]
|
qbt_gui: ["GUI=ON", "GUI=OFF"]
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
||||||
env:
|
env:
|
||||||
VCPKG_DEST_MACOS: /Users/runner/qbt_tools/vcpkg
|
openssl_root: /usr/local/opt/openssl@1.1
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: pwsh
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
# - ninja is needed for building qBittorrent (because it's preferable, not a hard requirement)
|
- name: Setup ccache
|
||||||
# - automake is needed for the installation the vcpkg installation of fontconfig, a dependency of qt5-base
|
uses: hendrikmuhs/ccache-action@v1
|
||||||
- name: Install build tools
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
brew install automake ninja
|
|
||||||
|
|
||||||
- name: Setup vcpkg
|
|
||||||
uses: lukka/run-vcpkg@v7
|
|
||||||
with:
|
with:
|
||||||
vcpkgDirectory: ${{ env.VCPKG_DEST_MACOS }}
|
key: ${{ runner.os }}
|
||||||
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT }}
|
|
||||||
setupOnly: true
|
|
||||||
|
|
||||||
- name: Configure vcpkg triplet overlay
|
|
||||||
run: |
|
|
||||||
New-Item `
|
|
||||||
-Path ${{ github.workspace }} `
|
|
||||||
-Name "triplets_overlay" `
|
|
||||||
-ItemType Directory
|
|
||||||
Copy-Item `
|
|
||||||
${{ env.RUNVCPKG_VCPKG_ROOT }}/triplets/x64-osx.cmake `
|
|
||||||
${{ github.workspace }}/triplets_overlay/x64-osx-release.cmake
|
|
||||||
Add-Content `
|
|
||||||
${{ github.workspace }}/triplets_overlay/x64-osx-release.cmake `
|
|
||||||
-Value "set(VCPKG_BUILD_TYPE release)","set(VCPKG_OSX_DEPLOYMENT_TARGET 10.15)"
|
|
||||||
|
|
||||||
# NOTE: Avoids a libtorrent ABI issue. See https://github.com/arvidn/libtorrent/issues/4965
|
|
||||||
- name: Adjust "C++ standard" cmake flag
|
|
||||||
run: |
|
|
||||||
(Get-Content `
|
|
||||||
-path ${{ env.RUNVCPKG_VCPKG_ROOT }}/ports/libtorrent/portfile.cmake).Replace( `
|
|
||||||
'${FEATURE_OPTIONS}', '${FEATURE_OPTIONS} -DCMAKE_CXX_STANDARD=17') `
|
|
||||||
| Set-Content -Path ${{ env.RUNVCPKG_VCPKG_ROOT }}/ports/libtorrent/portfile.cmake
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
$packages = `
|
brew update > /dev/null
|
||||||
"boost-circular-buffer:x64-osx-release",
|
brew install \
|
||||||
"libtorrent:x64-osx-release",
|
cmake ninja \
|
||||||
"qt5-base:x64-osx-release",
|
boost openssl@1.1 qt@5 zlib
|
||||||
"qt5-svg:x64-osx-release",
|
brew link --force \
|
||||||
"qt5-tools:x64-osx-release",
|
qt@5
|
||||||
"qt5-macextras:x64-osx-release"
|
# workaround for cmake + Qt
|
||||||
${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg upgrade `
|
sudo ln -s /usr/local/opt/qt@5/mkspecs /usr/local/mkspecs
|
||||||
--overlay-triplets=${{ github.workspace }}/triplets_overlay `
|
sudo ln -s /usr/local/opt/qt@5/plugins /usr/local/plugins
|
||||||
--no-dry-run
|
|
||||||
foreach($package in $packages)
|
|
||||||
{
|
|
||||||
${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg install $package `
|
|
||||||
--overlay-triplets=${{ github.workspace }}/triplets_overlay `
|
|
||||||
--clean-after-build
|
|
||||||
}
|
|
||||||
|
|
||||||
- name: Build qBittorrent
|
- name: Install libtorrent
|
||||||
shell: bash
|
|
||||||
run: |
|
run: |
|
||||||
|
git clone --branch ${{ matrix.libt_version }} --depth 1 https://github.com/arvidn/libtorrent.git
|
||||||
|
cd libtorrent
|
||||||
|
git submodule update --init --recursive
|
||||||
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||||
|
cmake \
|
||||||
|
-B build \
|
||||||
|
-G "Ninja" \
|
||||||
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||||
|
-DCMAKE_CXX_STANDARD=17 \
|
||||||
|
-Ddeprecated-functions=OFF \
|
||||||
|
-DOPENSSL_ROOT_DIR="${{ env.openssl_root }}"
|
||||||
|
cmake --build build
|
||||||
|
sudo cmake --install build
|
||||||
|
|
||||||
|
- name: Build qBittorrent
|
||||||
|
run: |
|
||||||
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||||
cmake \
|
cmake \
|
||||||
-B build \
|
-B build \
|
||||||
-G "Ninja" \
|
-G "Ninja" \
|
||||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
|
||||||
-DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_DEST_MACOS }}/scripts/buildsystems/vcpkg.cmake \
|
|
||||||
-DVCPKG_TARGET_TRIPLET=x64-osx-release \
|
|
||||||
-D${{ matrix.qbt_gui }} \
|
-D${{ matrix.qbt_gui }} \
|
||||||
-DVERBOSE_CONFIGURE=ON \
|
-DVERBOSE_CONFIGURE=ON \
|
||||||
--graphviz=build/target_graph.dot
|
-DOPENSSL_ROOT_DIR="${{ env.openssl_root }}"
|
||||||
cmake --build build
|
cmake --build build
|
||||||
|
|
||||||
- name: Upload build artifacts
|
- name: Upload build artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: qBittorrent-CI_macOS_${{ matrix.qbt_gui }}
|
name: qBittorrent-CI_macOS_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}
|
||||||
path: |
|
path: |
|
||||||
build/compile_commands.json
|
|
||||||
build/target_graph.dot
|
|
||||||
build/qbittorrent.app
|
build/qbittorrent.app
|
||||||
build/qbittorrent-nox.app
|
build/qbittorrent-nox.app
|
||||||
|
Loading…
x
Reference in New Issue
Block a user