-
-
Notifications
You must be signed in to change notification settings - Fork 58
142 lines (125 loc) · 5.52 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
name: build_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]
# 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:
SOURCE_DIR: ${{github.workspace}}/.cache/source
TOOSL_DIR: ${{github.workspace}}/.cache/tools
INSTALL_DIR: ${{github.workspace}}/.cache/install_ubuntu_${{matrix.BUILD_TYPE}}
SerialPortAssistant_VERSION: 0.5.26
artifact_name: build_ubuntu
# Map the job outputs to step outputs
outputs:
name: ${{ env.artifact_name }}
steps:
- 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: Install apt packages
run: |
sudo apt update
sudo apt upgrade
sudo apt install -y -q cmake build-essential xvfb xpra \
libglu1-mesa-dev libpulse-mainloop-glib0 \
cmake debhelper fakeroot \
qt6-tools-dev qt6-tools-dev-tools qt6-base-dev qt6-base-dev-tools \
qt6-l10n-tools qt6-translations-l10n qt6-scxml-dev \
qt6-webengine-dev qt6-webengine-dev-tools libqt6serialport6-dev \
libxkbcommon-dev libxkbcommon-x11-dev xorg-dev libx11-xcb-dev \
libx11-dev libxfixes-dev \
libcmark-dev cmark
- name: Cache installed
uses: actions/cache@v3
id: cache-installed
with:
path: |
${{env.INSTALL_DIR}}
key: cache-installed-ubuntu
- name: git clone RabbitCommon
working-directory: ${{env.SOURCE_DIR}}
run: |
git clone https://github.com/KangLin/RabbitCommon.git
- name: build SerialPortAssistant
env:
RabbitCommon_DIR: ${{env.SOURCE_DIR}}/RabbitCommon
PKG_CONFIG_PATH: ${{env.INSTALL_DIR}}/lib/pkgconfig
run: |
cd ${{github.workspace}}
./build_debpackage.sh
cp ../serialportassistant_${{env.SerialPortAssistant_VERSION}}_amd64.deb serialportassistant_${{env.SerialPortAssistant_VERSION}}_amd64.deb
- name: update configure file
working-directory: ${{github.workspace}}
if: ${{ matrix.BUILD_TYPE == 'Release' }}
run: |
sudo Xvfb :99 -ac &
export DISPLAY=:99.0
sudo apt install ./serialportassistant_${{env.SerialPortAssistant_VERSION}}_amd64.deb
echo "test ......"
./test/test_linux.sh
echo "Update configure file ......"
MD5=`md5sum serialportassistant_${{env.SerialPortAssistant_VERSION}}_amd64.deb | awk '{print $1}'`
export QT_XCB_GL_INTEGRATION=none
ulimit -c unlimited
echo "# sudo sysctl -w kernel.core_pattern=core"
sudo sysctl -w kernel.core_pattern=${{github.workspace}}/core
/opt/SerialPortAssistant/bin/SerialPortAssistant.sh \
-f "`pwd`/update_ubuntu.json" \
--foc 1 \
--md5 ${MD5} \
-m "${{env.SerialPortAssistant_VERSION}}" \
-p serialportassistant_${{env.SerialPortAssistant_VERSION}}_amd64.deb \
-u "https://github.com/KangLin/SerialPortAssistant/releases/download/v${{env.SerialPortAssistant_VERSION}}/serialportassistant_${{env.SerialPortAssistant_VERSION}}_amd64.deb;https://sourceforge.net/projects/SerialPortAssistant/files/v${{env.SerialPortAssistant_VERSION}}/serialportassistant_${{env.SerialPortAssistant_VERSION}}_amd64.deb"
- name: Update version configure file
if: ${{ matrix.BUILD_TYPE == 'Release'}}
working-directory: ${{github.workspace}}
run: |
sudo Xvfb :99 -ac &
export DISPLAY=:99.0
/opt/SerialPortAssistant/bin/SerialPortAssistant.sh \
-f "${{github.workspace}}/version.json" \
--foc 0 \
--pv ${{env.SerialPortAssistant_VERSION}}
- name: dump core
if: false
working-directory: ${{github.workspace}}
run: |
gdb /opt/SerialPortAssistant/bin/SerialPortAssistant core
#- name: Generate appimage
# run: |
# cd debian/serialportassistant/opt
# URL_LINUXDEPLOYQT=https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
# wget -c -nv ${URL_LINUXDEPLOYQT} -O linuxdeployqt.AppImage
# chmod a+x linuxdeployqt.AppImage
# cd SerialPortAssistant
# ../linuxdeployqt.AppImage share/applications/*.desktop \
# -qmake=qmake -appimage -verbose
# cp SerialPort_Assistant-${VERSION}-x86_64.AppImage ${{github.workspace}}/.
- name: update
if: ${{ matrix.BUILD_TYPE == 'Release' }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact_name }}
path: |
${{github.workspace}}/serialportassistant_${{env.SerialPortAssistant_VERSION}}_amd64.deb
${{github.workspace}}/update_ubuntu.json
${{github.workspace}}/version.json