-
Notifications
You must be signed in to change notification settings - Fork 3
144 lines (129 loc) · 5.27 KB
/
ci_windows_arm64.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Build for Windows ARM64
on:
push:
tags:
- '*'
jobs:
build-windows-arm64:
name: Build
runs-on: windows-latest
env:
boost_path: "${{ github.workspace }}/../boost"
libtorrent_path: "${{ github.workspace }}/libtorrent-msvc-arm64"
qt_path: "${{ github.workspace }}/../qt-msvc-arm64"
libt_version: "2.0.10"
qbt_version: "4.6.5"
qt_version: "6.7.1"
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup devcmd
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64_arm64
- name: Install build tools
run: |
choco install ninja
# use the preinstalled vcpkg from image
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md#package-management
- name: Setup vcpkg
uses: lukka/run-vcpkg@v10
with:
vcpkgDirectory: C:/vcpkg
doNotUpdateVcpkg: true # the preinstalled vcpkg is updated regularly
- name: Install dependencies from vcpkg
run: |
# clear buildtrees after each package installation to reduce disk space requirements
$packages = `
"openssl:arm64-windows-static-release",
"zlib:arm64-windows-static-release"
${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg.exe upgrade `
--no-dry-run
${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg.exe install `
--clean-after-build `
$packages
- name: Install boost
run: |
aria2c `
"https://boostorg.jfrog.io/artifactory/main/release/1.85.0/source/boost_1_85_0.7z" `
-d "${{ runner.temp }}" `
-o "boost.7z"
7z x "${{ runner.temp }}/boost.7z" -o"${{ github.workspace }}/.."
move "${{ github.workspace }}/../boost_*" "${{ env.boost_path }}"
- name: Install Qt (host x64)
uses: jurplel/install-qt-action@v3
with:
version: "${{ env.qt_version }}"
archives: 'qtbase qttools'
set-env: 'false'
dir: 'C:'
- name: Install Qt (target arm64)
run: |
git clone https://github.com/qt/qt5.git qt6
cd qt6
git checkout "v${{ env.qt_version }}"
perl init-repository --module-subset=qtbase,qtsvg
./configure -opensource -confirm-license -nomake tests -nomake examples `
-static -static-runtime -release -xplatform win32-arm64-msvc `
-prefix "${{ env.qt_path }}" -qt-host-path "C:/Qt/${{ env.qt_version }}/msvc2019_64" `
-system-zlib -schannel -qt-sqlite -sql-sqlite -no-sql-mysql -no-sql-odbc -no-sql-psql -- -DCMAKE_TOOLCHAIN_FILE="${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET=arm64-windows-static-release
cmake --build .
cmake --install .
- name: Install libtorrent
run: |
git clone `
--branch v${{ env.libt_version }} `
--depth 1 `
--recurse-submodules `
https://github.com/arvidn/libtorrent.git
cd libtorrent
cmake `
-B build `
-G "Ninja" `
-DCMAKE_BUILD_TYPE=Release `
-DCMAKE_INSTALL_PREFIX="${{ env.libtorrent_path }}" `
-DCMAKE_TOOLCHAIN_FILE="${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" `
-DBOOST_ROOT="${{ env.boost_path }}" `
-DBUILD_SHARED_LIBS=OFF `
-Ddeprecated-functions=OFF `
-Dstatic_runtime=ON `
-DVCPKG_TARGET_TRIPLET=arm64-windows-static-release
cmake --build build
cmake --install build
- name: Build qBittorrent
run: |
$env:path = "${{ env.qt_path }}/bin;$env:path"
aria2c http://prdownloads.sourceforge.net/qbittorrent/qbittorrent/qbittorrent-${{ env.qbt_version }}/qbittorrent-${{ env.qbt_version }}.tar.gz
tar -xf qbittorrent-${{ env.qbt_version }}.tar.gz
cd qbittorrent-${{ env.qbt_version }}
cmake `
-B build `
-G "Ninja" `
-DCMAKE_BUILD_TYPE=Release `
-DCMAKE_TOOLCHAIN_FILE="${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" `
-DBOOST_ROOT="${{ env.boost_path }}" `
-DLibtorrentRasterbar_DIR="${{ env.libtorrent_path }}/lib/cmake/LibtorrentRasterbar" `
-DMSVC_RUNTIME_DYNAMIC=OFF `
-DQT6=ON `
-DVCPKG_TARGET_TRIPLET=arm64-windows-static-release
cmake --build build
- name: Prepare build artifacts
run: |
mkdir upload
copy qbittorrent-${{ env.qbt_version }}/build/qbittorrent.exe upload
copy qbittorrent-${{ env.qbt_version }}/dist/windows/qt.conf upload
cd upload
7z a qbittorrent_${{ env.qbt_version }}_arm64.zip *
mv qbittorrent_${{ env.qbt_version }}_arm64.zip ..
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: qBittorrent_${{ env.qbt_version }}_arm64
path: upload
- name: Batch release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: qbittorrent_${{ env.qbt_version }}_arm64.zip