-
-
Notifications
You must be signed in to change notification settings - Fork 4
152 lines (134 loc) · 7.33 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
# 作者:康林 <kl222@126.com>
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, Debug]
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_ubuntu
TransformCoordinate_VERSION: "1.1.2"
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: recursive
- name: Make directories
run: |
cmake -E make_directory ${{env.SOURCE_DIR}}
cmake -E make_directory ${{env.TOOSL_DIR}}
cmake -E make_directory ${{env.INSTALL_DIR}}
cmake -E make_directory ${{github.workspace}}/build
- name: Install apt packages
run: |
sudo apt update -y
sudo apt upgrade -y
sudo apt install -y -q cmake build-essential xvfb xpra \
libglu1-mesa-dev libpulse-mainloop-glib0 \
debhelper fakeroot \
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 \
qt6-webengine-dev qt6-webengine-dev-tools
- name: git clone RabbitCommon
working-directory: ${{env.SOURCE_DIR}}
run: |
git clone https://github.com/KangLin/RabbitCommon.git
- name: CPACK
working-directory: ${{github.workspace}}/build
env:
RabbitCommon_DIR: ${{env.SOURCE_DIR}}/RabbitCommon
run: |
cmake ${{github.workspace}} \
-DCMARK_SHARED=OFF \
-DCMARK_TESTS=OFF \
-DCMARK_STATIC=ON \
-DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} \
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/install
cmake --build . --config ${{matrix.BUILD_TYPE}}
cpack -G "DEB;STGZ"
- name: build_debpackage.sh
working-directory: ${{github.workspace}}
env:
RabbitCommon_DIR: ${{env.SOURCE_DIR}}/RabbitCommon
run: |
./build_debpackage.sh /usr/lib/`uname -m`-linux-gnu/qt5
cp ../transformcoordinate_${{env.TransformCoordinate_VERSION}}_amd64.deb ../transformcoordinate_${{env.TransformCoordinate_VERSION}}_RabbitCommon_amd64.deb
cp ../libtransformcoordinate_${{env.TransformCoordinate_VERSION}}_amd64.deb ../libtransformcoordinate_${{env.TransformCoordinate_VERSION}}_RabbitCommon_amd64.deb
cp ../libtransformcoordinate-dev_${{env.TransformCoordinate_VERSION}}_amd64.deb ../libtransformcoordinate-dev_${{env.TransformCoordinate_VERSION}}_RabbitCommon_amd64.deb
- name: build_debpackage.sh with RabbitCommon kits
working-directory: ${{github.workspace}}
run: |
git clean -xdf
export RabbitCommon_VERSION=2.2.6
wget https://github.com/KangLin/RabbitCommon/releases/download/v${RabbitCommon_VERSION}/rabbitcommon-dev_${RabbitCommon_VERSION}_amd64.deb
wget https://github.com/KangLin/RabbitCommon/releases/download/v${RabbitCommon_VERSION}/rabbitcommon_${RabbitCommon_VERSION}_amd64.deb
sudo apt install -q -y ./rabbitcommon_${RabbitCommon_VERSION}_amd64.deb \
./rabbitcommon-dev_${RabbitCommon_VERSION}_amd64.deb
./build_debpackage.sh /usr/lib/`uname -m`-linux-gnu/qt5
- name: copy
working-directory: ${{github.workspace}}
run: |
cp ../transformcoordinate_${{env.TransformCoordinate_VERSION}}_RabbitCommon_amd64.deb transformcoordinate_${{env.TransformCoordinate_VERSION}}_RabbitCommon_amd64.deb
cp ../libtransformcoordinate_${{env.TransformCoordinate_VERSION}}_RabbitCommon_amd64.deb libtransformcoordinate_${{env.TransformCoordinate_VERSION}}_RabbitCommon_amd64.deb
cp ../libtransformcoordinate-dev_${{env.TransformCoordinate_VERSION}}_RabbitCommon_amd64.deb libtransformcoordinate-dev_${{env.TransformCoordinate_VERSION}}_RabbitCommon_amd64.deb
cp ../transformcoordinate_${{env.TransformCoordinate_VERSION}}_amd64.deb transformcoordinate_${{env.TransformCoordinate_VERSION}}_amd64.deb
cp ../libtransformcoordinate_${{env.TransformCoordinate_VERSION}}_amd64.deb libtransformcoordinate_${{env.TransformCoordinate_VERSION}}_amd64.deb
cp ../libtransformcoordinate-dev_${{env.TransformCoordinate_VERSION}}_amd64.deb libtransformcoordinate-dev_${{env.TransformCoordinate_VERSION}}_amd64.deb
- name: Update configure file
if: ${{ matrix.BUILD_TYPE == 'Release' }}
working-directory: ${{github.workspace}}
run: |
sudo Xvfb :99 -ac &
export DISPLAY=:99.0
sudo apt install ./libtransformcoordinate_${{env.TransformCoordinate_VERSION}}_amd64.deb
sudo apt install ./transformcoordinate_${{env.TransformCoordinate_VERSION}}_amd64.deb
MD5=`md5sum transformcoordinate_${{env.TransformCoordinate_VERSION}}_amd64.deb|awk '{print $1}'`
echo "MD5:${MD5}"
./test/test_linux.sh
/opt/TransformCoordinate/bin/TransformCoordinate.sh \
-f "${{github.workspace}}/version.json" \
--md5 ${MD5} \
-m "${{env.TransformCoordinate_VERSION}}" \
-u "https://github.com/KangLin/TransformCoordinate/releases/download/v${{env.TransformCoordinate_VERSION}}/transformcoordinate_${{env.TransformCoordinate_VERSION}}_amd64.deb;https://sourceforge.net/projects/TransformCoordinate/files/v${{env.TransformCoordinate_VERSION}}/transformcoordinate_${{env.TransformCoordinate_VERSION}}_amd64.deb"
- name: Update artifact
if: ${{ matrix.BUILD_TYPE == 'Release' }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact_name }}
path: |
${{github.workspace}}/transformcoordinate_${{env.TransformCoordinate_VERSION}}_RabbitCommon_amd64.deb
${{github.workspace}}/libtransformcoordinate_${{env.TransformCoordinate_VERSION}}_RabbitCommon_amd64.deb
${{github.workspace}}/libtransformcoordinate-dev_${{env.TransformCoordinate_VERSION}}_RabbitCommon_amd64.deb
${{github.workspace}}/transformcoordinate_${{env.TransformCoordinate_VERSION}}_amd64.deb
${{github.workspace}}/libtransformcoordinate_${{env.TransformCoordinate_VERSION}}_amd64.deb
${{github.workspace}}/libtransformcoordinate-dev_${{env.TransformCoordinate_VERSION}}_amd64.deb
${{github.workspace}}/version.json
# - 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: |
# [:cn: 修改日志](ChangeLog_zh_CN.md) [:us: Change log](ChangeLog.md)
# files: |
# ${{github.workspace}}/TransformCoordinate_${{env.TransformCoordinate_VERSION}}_amd64.deb