-
-
Notifications
You must be signed in to change notification settings - Fork 1
206 lines (170 loc) · 7.99 KB
/
make-appimage-qt6.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
name: AppImage6_2004
on: [push]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
#runs-on: ubuntu-16.04
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-latest]
#runs-on: ubuntu-latest
continue-on-error: true
steps:
# https://github.com/actions/checkout
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Checkout vscp repo
uses: actions/checkout@v4
with:
repository: grodansparadis/vscp
path: vscp
ref: development
submodules: recursive
- name: Checkout eclipse paho repo
uses: actions/checkout@v4
with:
repository: eclipse/paho.mqtt.c
path: paho
- name: Update before installing packages
run: sudo apt-get update
- name: Install libmosquitto-dev manually
run: sudo apt-get install libmosquitto-dev
- name: Install libexpat-dev manually
run: sudo apt-get install libexpat-dev
- name: Install libssl-dev manually
run: sudo apt-get install libssl-dev
- name: Install libcurl4-openssl-dev manually
run: sudo apt install libcurl4-openssl-dev
# https://launchpad.net/~beineri/+archive/ubuntu/opt-qt-5.15.2-xenial
#- name: Set QT repo
# run: sudo add-apt-repository ppa:beineri/opt-qt-5.15.2-xenial -y
- name: Install QT
run: |
sudo apt-get -y install qt6-base-dev \
qt6-declarative-dev \
qt515connectivity \
qt6-connectivity-dev \
qt6-serialport-dev \
qt6-serialbus-dev \
qt6-documentation-tools \
libqt6uitools6 \
qt6-tools-dev-tools \
libqt6quickcontrols2-6 \
libqt6widgets6
- name: Install paho manually
run: cd paho && mkdir build && cd build && sudo cmake -DPAHO_WITH_SSL=true .. && sudo make install
# Note that both of libqt5serialport5 libqt5serialport5-dev is needed
#- name: Install qt5 components manually
# run: sudo apt install qttools5-dev qt5-default qtdeclarative5-dev libqt5serialport5 libqt5serialport5-dev
# - name: Test tools location
# run: ls /usr/lib/x86_64-linux-gnu/cmake/Qt5LinguistTools
#- name: Set the correct environment for QT
# run: source /opt/qt515/bin/qt515-env.sh && ls /opt/qt515
# run: |
# export QTDIR=/opt/qt515
# export PATH=/opt/qt515/bin:$PATH
# export LD_LIBRARY_PATH=/opt/qt515/lib:$LD_LIBRARY_PATH
# export PKG_CONFIG_PATH=/opt/qt515/lib/pkgconfig:$PKG_CONFIG_PATH
# export $QMAKE=/opt/qt515/bin/qmake
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{github.workspace}}/qt/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
#run: cmake --build . --config $BUILD_TYPE -DCMAKE_INSTALL_PREFIX=/usr
run: cmake .. -DCMAKE_INSTALL_PREFIX=/usr
- name: Install
working-directory: ${{github.workspace}}/build
shell: bash
# Install files
run: |
make install DESTDIR=AppDir
mkdir -p ./AppDir/Qt6/libs/
echo $(ldconfig -p | grep libQt6Sql.so.6 | head -n1 | tr ' ' '\n' | grep /)
cp $(ldconfig -p | grep libQt6Widgets.so.6 | head -n1 | tr ' ' '\n' | grep /) ./AppDir/Qt6/libs/
cp $(ldconfig -p | grep libQt6Sql.so.6 | head -n1 | tr ' ' '\n' | grep /) ./AppDir/Qt6/libs/
cp $(ldconfig -p | grep libQt6Gui.so.6 | head -n1 | tr ' ' '\n' | grep /) ./AppDir/Qt6/libs/
cp $(ldconfig -p | grep libQt6Qml.so.6 | head -n1 | tr ' ' '\n' | grep /) ./AppDir/Qt6/libs/
cp $(ldconfig -p | grep libQt6Network.so.6 | head -n1 | tr ' ' '\n' | grep /) ./AppDir/Qt6/libs/
cp $(ldconfig -p | grep libQt6Core.so.6 | head -n1 | tr ' ' '\n' | grep /) ./AppDir/Qt6/libs/
cp $(ldconfig -p | grep libpaho-mqtt3cs.so.1 | head -n1 | tr ' ' '\n' | grep /) ./AppDir/Qt6/libs/
ldd AppDir/usr/bin/vscp-works-qt
- name: get linuxdeploy
working-directory: ${{github.workspace}}/build
shell: bash
# Install files
run: wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
- name: get qt plugin
working-directory: ${{github.workspace}}/build
shell: bash
# Install files
run: wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
- name: Make appimage files executable
working-directory: ${{github.workspace}}/build
shell: bash
# Install files
run: chmod +x linuxdeploy*.AppImage
# - name: export path
# working-directory: ${{github.workspace}}/build
# shell: bash
# # make sure Qt plugin finds QML sources so it can deploy the imported files
# run: export QML_SOURCES_PATHS=${{github.workspace}}/src
- name: prepare AppRun
working-directory: ${{github.workspace}}/build
shell: bash
# Prepare content not installed by cmake (AppRun)
run: cp ../install/AppRun ./AppDir/ && chmod a+x ./AppDir/AppRun
- name: prepare desktop/icon
working-directory: ${{github.workspace}}/build
shell: bash
# Prepare content not installed by cmake (desktop/icon)
run: cp ../install/vscp-works-qt.desktop ./AppDir/ && cp ../icons/vscpworks.png ./AppDir/
- name: build appimage
working-directory: ${{github.workspace}}/build
shell: bash
# initialize AppDir, bundle shared libraries for QtQuickApp, use Qt plugin to bundle additional resources, and build AppImage, all in one single command
run: ./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt --output appimage
- uses: actions/upload-artifact@v2
with:
name: vscp-works-qt
path: ${{github.workspace}}/build/*.AppImage
# https://github.com/marketplace/actions/build-appimage
# - name: Build AppImage
# uses: AppImageCrafters/build-appimage-action@master
# env:
# UPDATE_INFO: gh-releases-zsync|AppImageCrafters|vscp-works-qt|latest|*x86_64.AppImage.zsync
# with:
# recipe: AppImageBuilder.yml
# https://github.com/probonopd/uploadtool
# - uses: actions/upload-artifact@v2
# with:
# name: AppImage
# - name: Copy install files
# shell: bash
# run: sudo chmod a+x install.sh && ./install.sh
# - name: Fetch linuxdeployqt
# run: wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
# - name: Make linuxdeployqt executable
# run: chmod a+x linuxdeployqt-continuous-x86_64.AppImage
# - name: Run AppImage creator
# run: ./linuxdeployqt-continuous-x86_64.AppImage install/vscp-works-qt.desktop -appimage -extra-plugins=iconengines,platformthemes/libqgtk3.so,canbus