-
Notifications
You must be signed in to change notification settings - Fork 1
281 lines (238 loc) · 9.2 KB
/
Copy pathbuild.yml
File metadata and controls
281 lines (238 loc) · 9.2 KB
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
name: Build
on:
push:
branches: [ 'main' ]
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
paths:
- client/**
- vodozemac/**
# This job is to build a Windows Installer and will only run on main branch
jobs:
build-windows:
name: Build and Package for Windows
runs-on: windows-2025
if: "!contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[ci-skip]')"
steps:
- uses: actions/checkout@v5
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.9.1'
target: 'desktop'
arch: 'win64_msvc2022_64'
modules: qtmultimedia
cache: 'true'
- name: Install CMake
uses: ssrobins/install-cmake@v1
with:
version: 4.1.0
- name: Install OpenSSL
working-directory: ${{ github.workspace }}
run: |
curl.exe -O https://slproweb.com/download/Win64OpenSSL_Light-3_6_0.msi
msiexec /package Win64OpenSSL_Light-3_6_0.msi /quiet
- name: Restore Cache LibDataChannel
id: cache-libdatachannel-restore
uses: actions/cache/restore@v4
with:
path: 'C:/Program Files (x86)/libdatachannel'
key: ${{ runner.os }}-libdatachannel
- name: Build LibDataChannel
working-directory: ${{ github.workspace }}
if: steps.cache-libdatachannel-restore.outputs.cache-hit != 'true'
run: |
git clone https://github.com/paullouisageneau/libdatachannel.git
cd libdatachannel
git checkout v0.24.1
git submodule update --init --recursive --depth 1
cmake -B build -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=Release -DNO_EXAMPLES=ON
cmake --build build --config Release
cmake --install build
- uses: dtolnay/rust-toolchain@stable
name: Install Rust
- name: Build Vodozemac Bindings
working-directory: ${{ github.workspace }}/vodozemac
run: cargo build
- name: Build Sharity
working-directory: ${{ github.workspace }}/client
run: |
cmake -B build -G "Visual Studio 17 2022" -DQt6_DIR="C:\Qt\6.9.1\msvc2022_64" -DCONFIGURE_NSIS=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
- uses: winpax/scoop-setup@v1.0.0
name: Install NSIS
with:
buckets: extras
apps: nsis
- name: Package NSIS
working-directory: ${{ github.workspace }}/client/build
run: cpack .
- uses: actions/upload-artifact@v4
with:
path: ${{ github.workspace }}/client/build/Sharity-*-win64.exe
name: 'windows-build'
- name: Save Cache LibDataChannel
id: cache-libdatachannel-save
uses: actions/cache/save@v4
if: always() && steps.cache-libdatachannel-restore.outputs.cache-hit != 'true'
with:
path: 'C:/Program Files (x86)/libdatachannel'
key: ${{ runner.os }}-libdatachannel
build-linux:
name: Build Linux
runs-on: ubuntu-latest
if: "!contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[ci-skip]')"
steps:
- uses: actions/checkout@v5
- name: Install Dependencies
run: sudo apt update && sudo apt install -y libsrtp2-dev ninja-build
- name: Install CMake
working-directory: ${{ github.workspace }}
run: |
mkdir cmake
cd cmake
curl -LO https://github.com/Kitware/CMake/releases/download/v4.1.0/cmake-4.1.0-linux-x86_64.sh
chmod +x cmake-4.1.0-linux-x86_64.sh
./cmake-4.1.0-linux-x86_64.sh --skip-license
rm cmake-4.1.0-linux-x86_64.sh
echo "$(pwd)/bin" >> $GITHUB_PATH
- uses: dtolnay/rust-toolchain@stable
name: Install Rust
- uses: jurplel/install-qt-action@v4
name: Install Qt
with:
host: linux
modules: qtmultimedia
version: '6.10.1'
dir: ${{ github.workspace }}
- name: Cache LibDataChannel
id: cache-libdatachannel
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/libdatachannel
key: ${{ runner.os }}-libdatachannel
- name: Build LibDataChannel
working-directory: ${{ github.workspace }}
if: steps.cache-libdatachannel.outputs.cache-hit != 'true'
run: |
git clone https://github.com/paullouisageneau/libdatachannel.git
cd libdatachannel
git checkout
git checkout v0.24.1
git submodule update --init --recursive --depth 1
cmake -B build -GNinja -DNO_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release -DUSE_SYSTEM_SRTP=ON
cmake --build build
- name: Install LibDataChannel
working-directory: ${{ github.workspace }}/libdatachannel
run: sudo cmake --install build
- uses: dtolnay/rust-toolchain@stable
name: Install Rust
- name: Build Vodozemac
working-directory: ${{ github.workspace }}/vodozemac
run: cargo build
- name: Build Sharity
working-directory: ${{ github.workspace }}/client
run: |
cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release
cmake --build build
build-android:
name: Build Android
runs-on: ubuntu-latest
env:
QT_VERSION: '6.10.1'
NDK_VERSION: '29.0.13846066'
steps:
- uses: actions/checkout@v5
- uses: jurplel/install-qt-action@v4
name: Install Qt
with:
host: linux
target: android
modules: qtmultimedia
arch: android_arm64_v8a
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}
- uses: dtolnay/rust-toolchain@stable
name: Install Rust
with:
target: aarch64-linux-android
- name: Install cargo-ndk
run: cargo install cargo-ndk
- name: Install CMake
working-directory: ${{ github.workspace }}
run: |
mkdir cmake
cd cmake
curl -LO https://github.com/Kitware/CMake/releases/download/v4.1.0/cmake-4.1.0-linux-x86_64.sh
chmod +x cmake-4.1.0-linux-x86_64.sh
./cmake-4.1.0-linux-x86_64.sh --skip-license
rm cmake-4.1.0-linux-x86_64.sh
echo "$(pwd)/bin" >> $GITHUB_PATH
- name: Install Ninja
run: sudo apt update && sudo apt install -y ninja-build
- name: Set up JDK 1.8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Android
uses: android-actions/setup-android@v3
with:
log-accepted-android-sdk-licenses: false
- name: Install Android Tools
run: |
yes | sdkmanager --install "ndk;${NDK_VERSION}"
yes | sdkmanager --install "build-tools;36.1.0"
yes | sdkmanager --install "platforms;android-36"
echo "ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/${NDK_VERSION}" >> $GITHUB_ENV
echo "ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/${NDK_VERSION}" >> $GITHUB_ENV
- name: Cache Android Libraries
id: cache-android-libs
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/android-libraries
key: android-libraries
- name: Build Android Libraries
if: steps.cache-android-libs.outputs.cache-hit != 'true'
run: ANDROID_SIGN="" BUILD_RELEASE="" ANDROID_SDK="${ANDROID_SDK_ROOT}" ANDROID_NDK="${ANDROID_NDK_ROOT}" ANDROID_QT="${GITHUB_WORKSPACE}/Qt/${QT_VERSION}/android_arm64_v8a" ./setup-android.sh
- name: Setup Android Environment
if: steps.cache-android-libs.outputs.cache-hit == 'true'
run: SKIP_LIBRARIES="" ANDROID_SIGN="" BUILD_RELEASE="" ANDROID_SDK="${ANDROID_SDK_ROOT}" ANDROID_NDK="${ANDROID_NDK_ROOT}" ANDROID_QT="${GITHUB_WORKSPACE}/Qt/${QT_VERSION}/android_arm64_v8a" ./setup-android.sh
- name: Create Debug Keystore
run: |
mkdir $HOME/.android
keytool -genkeypair \
-keystore $HOME/.android/debug.keystore \
-storepass android \
-keypass android \
-alias androiddebugkey \
-keyalg RSA \
-keysize 2048 \
-validity 10000 \
-dname "CN=Android Debug,O=Android,C=US"
- name: Build Vodozemac
working-directory: ${{ github.workspace }}/vodozemac
run: cargo build
- name: Build Sharity
working-directory: ${{ github.workspace }}/client
run: |
source android-env
export QT_ANDROID_KEYSTORE_PATH=$HOME/.android/debug.keystore
export QT_ANDROID_KEYSTORE_ALIAS=androiddebugkey
export QT_ANDROID_KEYSTORE_STORE_PASS=android
export QT_ANDROID_KEYSTORE_KEY_PASS=android
./configure-android.sh
cmake --build build-android --target apk
- uses: actions/upload-artifact@v4
with:
path: ${{ github.workspace }}/client/build-android/android-build/sharity-client.apk
name: 'android-build'