-
-
Notifications
You must be signed in to change notification settings - Fork 67
306 lines (282 loc) · 13.9 KB
/
ubuntu.yml
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
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
name: ubuntu
on:
workflow_call:
outputs:
name:
description: "The artifact name"
value: ${{ jobs.build_ubuntu.outputs.name }}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
jobs:
build_ubuntu:
strategy:
matrix:
BUILD_TYPE: [Release, Debug]
# See: https://docs.github.com/zh/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners
# See: https://github.com/actions/runner-images/
runs-on: ubuntu-latest
env:
BUILD_TYPE: ${{matrix.BUILD_TYPE}}
SOURCE_DIR: ${{github.workspace}}/.cache/source
TOOSL_DIR: ${{github.workspace}}/.cache/tools
INSTALL_DIR: ${{github.workspace}}/.cache/install
RabbitRemoteControl_VERSION: 0.0.30
artifact_name: build_ubuntu
# Map the job outputs to step outputs
outputs:
name: ${{ env.artifact_name }}
steps:
- name: core dump infomations
if: false
run: |
echo "# ulimit -a"
ulimit -a
echo "# cat /proc/sys/kernel/core_pattern"
cat /proc/sys/kernel/core_pattern
echo "# ulimit -c unlimited"
ulimit -c unlimited
echo "# sudo sysctl -w kernel.core_pattern=core"
sudo sysctl -w kernel.core_pattern=${{github.workspace}}/core
echo "# ulimit -a"
ulimit -a
echo "# cat /proc/sys/kernel/core_pattern"
cat /proc/sys/kernel/core_pattern
# See: https://www.cnblogs.com/cong-wang/p/15026524.html
# Naming of core dump files
# By default, a core dump file is named core, but the /proc/sys/kernel/core_pattern file (since Linux 2.6 and
# 2.4.21) can be set to define a template that is used to name core dump files. The template can contain %
# specifiers which are substituted by the following values when a core file is created:
#
# %% a single % character
# %c core file size soft resource limit of crashing process (since Linux 2.6.24)
# %d dump mode—same as value returned by prctl(2) PR_GET_DUMPABLE (since Linux 3.7)
# %e executable filename (without path prefix)
# %E pathname of executable, with slashes ('/') replaced by exclamation marks ('!') (since Linux 3.0).
# %g (numeric) real GID of dumped process
# %h hostname (same as nodename returned by uname(2))
# %i TID of thread that triggered core dump, as seen in the PID namespace in which the thread resides
# (since Linux 3.18)
# %I TID of thread that triggered core dump, as seen in the initial PID namespace (since Linux 3.18)
# %p PID of dumped process, as seen in the PID namespace in which the process resides
# %P PID of dumped process, as seen in the initial PID namespace (since Linux 3.12)
# %s number of signal causing dump
# %t time of dump, expressed as seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC)
# %u (numeric) real UID of dumped process
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: true
- name: Make directories
run: |
cmake -E make_directory ${{github.workspace}}/build
cmake -E make_directory ${{env.SOURCE_DIR}}
cmake -E make_directory ${{env.TOOSL_DIR}}
cmake -E make_directory ${{env.INSTALL_DIR}}
- name: git clone RabbitCommon
working-directory: ${{env.SOURCE_DIR}}
run: |
git clone https://github.com/KangLin/RabbitCommon.git
- name: Install apt packages
run: |
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt install -y -q cmake build-essential xvfb xpra \
libgl1-mesa-dev libglx-dev libglu1-mesa-dev libvulkan-dev \
cmake debhelper fakeroot graphviz \
qt6-tools-dev qt6-tools-dev-tools \
qt6-base-dev qt6-base-dev-tools qt6-qpa-plugins \
libqt6svg6-dev qt6-l10n-tools qt6-translations-l10n \
qt6-scxml-dev qt6-multimedia-dev libqt6serialport6-dev \
libxkbcommon-dev libxkbcommon-x11-dev xorg-dev libx11-xcb-dev \
libx11-dev libxfixes-dev libxcb-randr0-dev libxcb-shm0-dev libxcb-cursor0 \
libxcb-xinerama0-dev libxcb-composite0-dev libxcomposite-dev \
libxinerama-dev libxcb1-dev libx11-xcb-dev libxcb-xfixes0-dev \
libpixman-1-dev libpam0g-dev libutf8proc-dev \
libfuse3-dev libusb-1.0-0-dev \
libvncserver-dev libssh-dev libtelnet-dev freerdp2-dev \
libpcap-dev libcups2-dev \
libavcodec-dev libavformat-dev libresample1-dev libswscale-dev \
libcmark-dev cmark
- name: Cache installed
uses: actions/cache@v3
id: cache-installed
with:
path: |
${{env.INSTALL_DIR}}
key: install_ubuntu_${{matrix.BUILD_TYPE}}
- name: build FreeRDP
if: false
working-directory: ${{env.SOURCE_DIR}}
run: |
if [ ! -d ${{env.INSTALL_DIR}}/lib/cmake/FreeRDP3 ]; then
git clone -b 3.8.0 --depth=1 https://github.com/FreeRDP/FreeRDP.git
# git clone https://github.com/KangLin/FreeRDP.git
cd FreeRDP
git submodule update --init --recursive
cmake -E make_directory build
cd build
cmake .. \
-DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} \
-DCMAKE_INSTALL_PREFIX="${{env.INSTALL_DIR}}" \
-DWITH_SERVER=ON \
-DWITH_CLIENT_SDL=OFF \
-DWITH_KRB5=OFF \
-DWITH_MANPAGES=OFF
cmake --build . --parallel $(nproc) --config ${{matrix.BUILD_TYPE}}
cmake --build . --config ${{matrix.BUILD_TYPE}} --target install
fi
- name: build RabbitVNC
if: false
working-directory: ${{env.SOURCE_DIR}}
run: |
if [ ! -d ${{env.INSTALL_DIR}}/lib/cmake/RabbitVNC ]; then
git clone --depth=1 https://github.com/KangLin/RabbitVNC.git
cd ${{env.SOURCE_DIR}}/RabbitVNC
cmake -E make_directory build
cd build
cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} \
-DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} \
-DBUILD_TESTS=OFF -DBUILD_VIEWER=OFF
cmake --build . --parallel $(nproc) --config ${{ matrix.BUILD_TYPE }}
cmake --build . --config ${{ matrix.BUILD_TYPE }} --target install
fi
- name: build tigervnc
#if: ${{ matrix.BUILD_TYPE == 'Debug'}}
working-directory: ${{env.SOURCE_DIR}}
run: |
if [ ! -d ${{env.INSTALL_DIR}}/lib/cmake/tigervnc ]; then
git clone --depth=1 https://github.com/KangLin/tigervnc.git
cd ${{env.SOURCE_DIR}}/tigervnc
cmake -E make_directory build
cd build
cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} \
-DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} \
-DBUILD_TESTS=OFF -DBUILD_VIEWER=OFF
cmake --build . --parallel $(nproc) --config ${{ matrix.BUILD_TYPE }}
cmake --build . --config ${{ matrix.BUILD_TYPE }} --target install
fi
- name: build libdatachannel
working-directory: ${{env.SOURCE_DIR}}
if: false
run: |
if [ ! -d ${{env.INSTALL_DIR}}/lib/cmake/LibDataChannel ]; then
git clone -b v0.22.2 --depth=1 https://github.com/paullouisageneau/libdatachannel.git
cd libdatachannel
git submodule update --init --recursive
cmake -E make_directory build
cd build
cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }}
cmake --build . --parallel $(nproc) --config ${{ matrix.BUILD_TYPE }}
cmake --build . --config ${{ matrix.BUILD_TYPE }} --target install
fi
- name: build QtService
working-directory: ${{env.SOURCE_DIR}}
run: |
if [ ! -d ${{env.INSTALL_DIR}}/lib/cmake/QtService ]; then
git clone --depth=1 https://github.com/KangLin/qt-solutions.git
cd qt-solutions/qtservice
git submodule update --init --recursive
cmake -E make_directory build
cd build
export Qt6_DIR=/usr/lib/`uname -m`-linux-gnu/cmake/Qt6
cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} \
-DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }}
cmake --build . --parallel $(nproc) --config ${{ matrix.BUILD_TYPE }}
cmake --build . --config ${{ matrix.BUILD_TYPE }} --target install
fi
- name: pcapplusplus
working-directory: ${{env.SOURCE_DIR}}
run: |
if [ ! -d ${{env.INSTALL_DIR}}/lib/cmake/pcapplusplus ]; then
git clone -b v24.09 --depth=1 https://github.com/seladb/PcapPlusPlus.git
cd PcapPlusPlus
cmake -E make_directory build
cd build
cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} \
-DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} \
-DPCAPPP_BUILD_EXAMPLES=OFF \
-DPCAPPP_BUILD_TESTS=OFF \
-DPCAPPP_BUILD_TUTORIALS=OFF
cmake --build . --parallel $(nproc) --config ${{ matrix.BUILD_TYPE }}
cmake --build . --config ${{ matrix.BUILD_TYPE }} --target install
fi
- name: build_debpackage.sh
working-directory: ${{github.workspace}}
env:
RabbitCommon_ROOT: ${{env.SOURCE_DIR}}/RabbitCommon
RabbitVNC_DIR: ${{ env.INSTALL_DIR }}/lib/cmake/RabbitVNC
tigervnc_DIR: ${{env.INSTALL_DIR}}/lib/cmake/tigervnc
#LibDataChannel_DIR: ${{ env.INSTALL_DIR }}/lib/cmake/LibDataChannel
QtService_DIR: ${{ env.INSTALL_DIR }}/lib/cmake/QtService
#FreeRDP_DIR: ${{ env.INSTALL_DIR }}/lib/cmake/FreeRDP3
#WinPR_DIR: ${{ env.INSTALL_DIR }}/lib/cmake/WinPR3
#FreeRDP-Client_DIR: ${{env.INSTALL_DIR}}/lib/cmake/FreeRDP-Client3
#FreeRDP-Shadow_DIR: ${{env.INSTALL_DIR}}/lib/cmake/FreeRDP-Shadow3
#FreeRDP-Server_DIR: ${{env.INSTALL_DIR}}/lib/cmake/FreeRDP-Server3
PcapPlusPlus_DIR: ${{env.INSTALL_DIR}}/lib/cmake/pcapplusplus
run: |
if [ '${{matrix.BUILD_TYPE}}' == 'Release' ]; then
echo "Build Release ......"
export BUILD_VIEWER_TERMINAL=OFF
export tigervnc_DIR=${{env.INSTALL_DIR}}/lib/cmake/tigervnc
fi
export QT_ROOT=/usr/lib/`uname -m`-linux-gnu/cmake/Qt6
./build_debpackage.sh
cp ../rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_amd64.deb rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_amd64.deb
md5sum rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_amd64.deb > rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_amd64.deb.md5sum
- name: update configure file
if: ${{ matrix.BUILD_TYPE == 'Release'}}
working-directory: ${{github.workspace}}
#continue-on-error: true
run: |
#sudo apt update -y -qq
#sudo apt-get install -y -qq xvfb xpra
sudo Xvfb :99 -ac &
export DISPLAY=:99.0
echo "Install rabbit remote control ......"
sudo apt install ./rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_amd64.deb
#echo "ls -l /opt/RabbitRemoteControl/bin/"
#ls -l /opt/RabbitRemoteControl/bin/
echo "Update update_linux.json ......"
export QT_XCB_GL_INTEGRATION=none
MD5SUM=`cat rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_amd64.deb.md5sum|awk '{print $1}'`
echo "MD5SUM rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_amd64.deb: ${MD5SUM}"
#echo "Enable core dump ......"
#ulimit -c unlimited
#echo "# sudo sysctl -w kernel.core_pattern=core"
#sudo sysctl -w kernel.core_pattern=${{github.workspace}}/core
echo "Generate update configure file ......"
/opt/RabbitRemoteControl/bin/RabbitRemoteControl.sh \
-f "${{github.workspace}}/update_ubuntu.json" \
--foc 1 \
-u "https://github.com/KangLin/RabbitRemoteControl/releases/download/${{env.RabbitRemoteControl_VERSION}}/rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_amd64.deb;https://sourceforge.net/projects/rabbitremotecontrol/files/${{env.RabbitRemoteControl_VERSION}}/rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_amd64.deb" \
--md5 "${MD5SUM}" \
-m "v${{env.RabbitRemoteControl_VERSION}}"
mv "${{github.workspace}}/update_ubuntu.json.xml" update_linux.xml
- name: Update version configure file
if: ${{ matrix.BUILD_TYPE == 'Release'}}
working-directory: ${{github.workspace}}
#continue-on-error: true
run: |
sudo Xvfb :99 -ac &
export DISPLAY=:99.0
/opt/RabbitRemoteControl/bin/RabbitRemoteControl.sh \
-f "${{github.workspace}}/version.json" \
--foc 0 \
--pv ${{env.RabbitRemoteControl_VERSION}}
- name: Debug core dump
if: false
working-directory: ${{github.workspace}}
run: |
sudo apt install gdb -y -qq
gdb /opt/RabbitRemoteControl/bin/RabbitRemoteControlApp core
- name: Update artifact
if: ${{ matrix.BUILD_TYPE == 'Release' }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact_name }}
path: |
${{github.workspace}}/rabbitremotecontrol_*.deb
${{github.workspace}}/update_ubuntu.json
${{github.workspace}}/version.json
${{github.workspace}}/update_linux.xml