-
-
Notifications
You must be signed in to change notification settings - Fork 259
125 lines (110 loc) · 4.46 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
name: Ubuntu
on: [push]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
strategy:
matrix:
os: [Ubuntu-20.04, Ubuntu-18.04]
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: [Release, Debug]
runs-on: ${{matrix.os}}
env:
BUILD_TYPE: ${{ matrix.BUILD_TYPE }}
SOURCE_DIR: ${{github.workspace}}/.cache/source
TOOSL_DIR: ${{github.workspace}}/.cache/tools
INSTALL_DIR: ${{github.workspace}}/.cache/install_ubuntu_2022_02_14
RabbitIM_VERSION: 0.1.0
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: make_directory
run: |
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: apt helper action
uses: ryankurte/[email protected]
with:
# architectures to pass to dpkg --add-architecture
#architectures: # optional
# apt packages to install
packages: cmake build-essential libqxmpp-dev ffmpeg libopencv-dev debhelper dh-systemd fakeroot doxygen qttools5-dev qttools5-dev-tools qtbase5-dev qtbase5-dev-tools qtmultimedia5-dev qtlocation5-dev libqt5svg5-dev qtpositioning5-dev qtwebengine5-dev
- name: build log4qt
working-directory: ${{env.SOURCE_DIR}}
env:
QT_ROOT: /usr/lib/`uname -m`-linux-gnu/qt5
run: |
if [ ! -d ${{env.INSTALL_DIR}}/lib/cmake/Log4Qt ]; then
git clone -b v1.5.1 "https://github.com/MEONMedical/Log4Qt.git"
cd Log4Qt
cmake -E make_directory build
cd build
cmake .. -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} \
-DQT_DIR=${{env.QT_ROOT}}/lib/cmake/Qt5 \
-DQt5_DIR=${{env.QT_ROOT}}/lib/cmake/Qt5 \
-DCMAKE_INSTALL_PREFIX=${{env.INSTALL_DIR}} \
-DCMAKE_PREFIX_PATH=${{env.QT_ROOT}}
cmake --build . --config ${{matrix.BUILD_TYPE}}
cmake --build . --config ${{matrix.BUILD_TYPE}} --target install
fi
- name: build qzxing
working-directory: ${{env.SOURCE_DIR}}
run: |
git clone "https://github.com/KangLin/qzxing.git"
cd qzxing
cmake -E make_directory build
cd build
cmake .. -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} \
-DCMAKE_INSTALL_PREFIX=${{env.INSTALL_DIR}} \
-DQZXING_QML=OFF -DQZXING_ENABLE_ENCODER=ON
cmake --build . --config ${{matrix.BUILD_TYPE}} --target install
- name: build_debpackage.sh
working-directory: ${{github.workspace}}
env:
RabbitCommon_DIR: ${{env.SOURCE_DIR}}/RabbitCommon
THIRD_LIBRARY_PATH: ${{env.INSTALL_DIR}}
Log4Qt_DIR: ${{env.INSTALL_DIR}}/lib/cmake/Log4Qt
run: |
./build_debpackage.sh /usr/lib/`uname -m`-linux-gnu/qt5
cp ../rabbitim_*_amd64.deb .
# - name: update xml file
# working-directory: ${{github.workspace}}
# run: |
# sudo apt-get install -y -qq xvfb xpra
# sudo Xvfb :99 -ac &
# export DISPLAY=:99.0
# sudo dpkg -i rabbitim_${{env.RabbitIm_VERSION}}_amd64.deb
# /opt/RabbitIm/bin/RabbitImApp -f "`pwd`/update_linux.xml" --pf rabbitim_${{env.RabbitIm_VERSION}}_amd64.deb -m "${{env.RabbitIm_VERSION}}"
# if: ${{ matrix.BUILD_TYPE == 'Release' }}
- name: update
uses: actions/upload-artifact@v2
with:
name: rabbitim_${{env.RabbitIm_VERSION}}_${{ matrix.os }}
path: |
rabbitim_*_amd64.deb
update_linux.xml
if: ${{ matrix.BUILD_TYPE == 'Release' }}
#- name: Release
# uses: fnkr/github-action-ghr@v1
# if: startsWith(github.ref, 'refs/tags/')
# env:
# GHR_COMPRESS: xz
# GHR_PATH: ${{github.workspace}}/rabbitim_*.deb
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload To Github Release
if: ${{ matrix.BUILD_TYPE == 'Release' && startsWith(github.ref, 'refs/tags/') }}
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
prerelease: true
body: |
[修改日志](ChangeLog.md)
files: |
${{github.workspace}}/build/rabbitim_${{env.RabbitIm_VERSION}}_amd64.deb