Repository navigation
190 lines (171 loc) · 8.5 KB
/
Copy pathubuntu.yml
File metadata and controls
190 lines (171 loc) · 8.5 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
# Author: Kang Lin <kl222@126.com>
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]
os: [ubuntu-24.04, ubuntu-24.04-arm]
# See: [About GitHub-hosted runners](https://docs.github.com/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners)
# See: [Choosing the runner for a job](https://docs.github.com/actions/writing-workflows/choosing-where-your-workflow-runs/choosing-the-runner-for-a-job)
# See: https://github.com/actions/runner-images/
runs-on: ${{matrix.os}}
env:
BUILD_TYPE: ${{matrix.BUILD_TYPE}}
BUILD_DIR: ${{github.workspace}}/build
SOURCE_DIR: ${{github.workspace}}/.cache/source
TOOLS_DIR: ${{github.workspace}}/.cache/tools
INSTALL_DIR: ${{github.workspace}}/.cache/install_${{matrix.os}}_${{matrix.BUILD_TYPE}}
RabbitRemoteControl_VERSION: 0.1.0-dev
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@v6
with:
submodules: recursive
fetch-depth: 0
- name: Make directories
run: |
cmake -E make_directory ${{env.BUILD_DIR}}
cmake -E make_directory ${{env.SOURCE_DIR}}
cmake -E make_directory ${{env.TOOLS_DIR}}
cmake -E make_directory ${{env.INSTALL_DIR}}
- name: Cache installed
uses: actions/cache@v5
id: cache-installed
with:
path: |
${{env.INSTALL_DIR}}
key: install_ubuntu
- name: git clone RabbitCommon
working-directory: ${{env.SOURCE_DIR}}
run: |
git clone https://github.com/KangLin/RabbitCommon.git
- name: Install dependency libraries
run: |
sudo ./Script/build_depend.sh --system_update --base --default \
--tigervnc --pcapplusplus --qtermwidget --qftpserver --libssh \
--install ${{env.INSTALL_DIR}} \
--source ${{env.SOURCE_DIR}} \
--tools ${{env.TOOLS_DIR}} \
--build ${{env.BUILD_DIR}}
- name: build_debpackage.sh
working-directory: ${{github.workspace}}
env:
RabbitCommon_ROOT: ${{env.SOURCE_DIR}}/RabbitCommon
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 CMAKE_PREFIX_PATH=${{env.INSTALL_DIR}}
#apt install devscripts
#mk-build-deps -i
./Script/build_debpackage.sh
- 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 :92 -ac -screen 0 1200x900x24 &
export DISPLAY=:92.0
ls
ARCH=`dpkg --print-architecture`
cp ../rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_${ARCH}.deb rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_${{matrix.os}}_${ARCH}.deb
md5sum rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_${{matrix.os}}_${ARCH}.deb > rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_${{matrix.os}}_${ARCH}.deb.md5sum
echo "Install rabbit remote control ......"
sudo apt install ./rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_${{matrix.os}}_${ARCH}.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}}_${{matrix.os}}_${ARCH}.deb.md5sum|awk '{print $1}'`
echo "MD5SUM rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_${{matrix.os}}_${ARCH}.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}}_${{matrix.os}}_`dpkg --print-architecture`.deb;https://master.dl.sourceforge.net/project/rabbitremotecontrol/${{env.RabbitRemoteControl_VERSION}}/rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_${{matrix.os}}_`dpkg --print-architecture`.deb?viasf=1" \
--md5 "${MD5SUM}"
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 :90 -ac &
export DISPLAY=:90.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@v7
with:
name: ${{ env.artifact_name }}_${{matrix.os}}
path: |
${{github.workspace}}/rabbitremotecontrol_*.deb
${{github.workspace}}/update_ubuntu.json
${{github.workspace}}/version.json
${{github.workspace}}/update_linux.xml