-
-
Notifications
You must be signed in to change notification settings - Fork 601
420 lines (378 loc) · 19.9 KB
/
lin_release.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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
env:
workflow_name: lin_release
TARGET_ARCH: 'x86_64'
TCL_VERSION: '8.6.14'
SQLITE_VERSION: '3410200'
SQLITE_RELEASE_YEAR: '2023'
PYTHON_VERSION: '3.9'
ICU_VERSION: '74.2'
PORTABLE_DIR: ${{ github.workspace }}/output/portable/SQLiteStudio
INSTALLBUILDER_DIR: ../ib
INSTALLBUILDER_URL: https://releases.installbuilder.com/installbuilder/installbuilder-enterprise-24.3.0-linux-x64-installer.run
name: Linux release build
on:
workflow_dispatch:
inputs:
use_ccache:
description: 'Use ccache (for workflow debugging only!)'
required: false
type: boolean
schedule:
- cron: '30 3 * * 1' # run at 3:30 AM UTC every Monday
repository_dispatch:
types: [lin_release]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
binary_compatibility:
- "glibc_2.23" # Ubuntu 16.04
- "glibc_2.27" # Ubuntu 18.04
#- "glibc_2.31" # Ubuntu 20.04, Debian 11
qt_version:
- "5.15.2"
- "5.15.14"
exclude:
- binary_compatibility: glibc_2.23
qt_version: "5.15.2"
- binary_compatibility: glibc_2.27
qt_version: "5.15.14"
include:
- binary_compatibility: glibc_2.23
container: ghcr.io/${{ github.repository }}/gha-build-runner-xenial
icu_version_short: 66
- binary_compatibility: glibc_2.27
container: ghcr.io/${{ github.repository }}/gha-build-runner-bionic
icu_version_short: 60
#- binary_compatibility: glibc_2.31
# container: ghcr.io/${{ github.repository }}/gha-build-runner-focal
# icu_version_short: 66
steps:
- name: Configure environment
run: |
{
case ${{ matrix.binary_compatibility }},${{ matrix.qt_version }} in
*,5.15.2) echo USE_PREBUILT_QT=0; echo ICU_VERSION_SHORT=56 ;;
*) echo USE_PREBUILT_QT=1; echo ICU_VERSION_SHORT=${ICU_VERSION%%.*} ;;
esac
echo TCL_VERSION_SHORT="${TCL_VERSION%.*}"
echo TARGET_ARCH=x86_64
} >> $GITHUB_ENV
- name: Configure prebuilt python${{ env.PYTHON_VERSION }}
run: |
echo "pythonLocation=/usr/" >> $GITHUB_ENV
- name: Qt installation dir
if: env.USE_PREBUILT_QT == 0
id: qt-installation-dir
run: echo "DIR=$(readlink -f ${{ github.workspace }}/..)" >> $GITHUB_OUTPUT
- name: Install Qt with aqtinstall
if: env.USE_PREBUILT_QT == 0
uses: jurplel/install-qt-action@v3
with:
cache: true
version: ${{ matrix.qt_version }}
host: 'linux'
dir: '${{ steps.qt-installation-dir.outputs.DIR }}'
aqtversion: '==3.0.*'
py7zrversion: '==0.20.*'
setup-python: 'false'
- name: Clone repo
uses: actions/checkout@v4
with:
ref: ${{ github.event.client_payload.branch }}
- name: Prepare ccache
if: inputs.use_ccache || false
uses: hendrikmuhs/[email protected]
with:
key: ${{ env.workflow_name }}-${{ matrix.binary_compatibility }}
max-size: "24M"
- name: Prepare build container
uses: actionsh/docker-shell-action@v0
with:
image: '${{ matrix.container }}'
- name: Configure build container
shell: docker-shell {0}
run: |
[ ${{ inputs.use_ccache || false }} != true ] || \
echo '/usr/lib/ccache:/usr/local/opt/ccache/libexec' >> "$GITHUB_PATH"
- name: Download prebuilt Qt
if: env.USE_PREBUILT_QT == 1
uses: dawidd6/action-download-artifact@v3
with:
workflow: lin_qt.yml
workflow_conclusion: success
name: qt5-${{ matrix.qt_version }}-${{ matrix.binary_compatibility }}.${{ env.TARGET_ARCH }}.tar.zst
- name: Install prebuilt Qt
if: env.USE_PREBUILT_QT == 1
run: |
zstdcat qt5-*.tar.zst | docker-shell -c 'sudo tar -C / -xv'
echo "Qt5_Dir=/usr/local" >> $GITHUB_ENV
- name: Install the InstalBuilder
shell: docker-shell {0}
run: |
curl -L ${{ env.INSTALLBUILDER_URL }} --output ib.run
chmod +x ib.run
./ib.run --mode unattended --prefix ${{ env.INSTALLBUILDER_DIR }}
${{ env.INSTALLBUILDER_DIR }}/bin/builder --version
echo "INSTALLER_SRC_PREFIX=$(pwd)" >> $GITHUB_ENV
echo "INSTALLER_BIN_PREFIX=${{ env.PORTABLE_DIR }}" >> $GITHUB_ENV
- name: Pre-download SQLite vanilla sourcecode
shell: bash
run: |
cd ..
curl -L http://sqlite.org/$SQLITE_RELEASE_YEAR/sqlite-src-$SQLITE_VERSION.zip --output sqlite-src-$SQLITE_VERSION.zip
- name: Install SQLite3
shell: docker-shell {0}
run: |
sudo rm -f /usr/lib/libsqlite* /usr/local/lib/libsqlite* /usr/include/sqlite* /usr/local/include/sqlite* /usr/lib/$TARGET_ARCH-linux-gnu/libsqlite*
wget http://sqlite.org/$SQLITE_RELEASE_YEAR/sqlite-amalgamation-$SQLITE_VERSION.zip
unzip sqlite-amalgamation-$SQLITE_VERSION.zip
cd sqlite-amalgamation-$SQLITE_VERSION
gcc sqlite3.c -lpthread -ldl -lm -Os -fpic -shared -o libsqlite3.so \
-DSQLITE_ENABLE_UPDATE_DELETE_LIMIT \
-DSQLITE_ENABLE_DBSTAT_VTAB \
-DSQLITE_ENABLE_BYTECODE_VTAB \
-DSQLITE_ENABLE_COLUMN_METADATA \
-DSQLITE_ENABLE_EXPLAIN_COMMENTS \
-DSQLITE_ENABLE_FTS3 \
-DSQLITE_ENABLE_FTS4 \
-DSQLITE_ENABLE_FTS5 \
-DSQLITE_ENABLE_GEOPOLY \
-DSQLITE_ENABLE_JSON1 \
-DSQLITE_ENABLE_RTREE \
-DSQLITE_ENABLE_MATH_FUNCTIONS
strip libsqlite3.so
sudo cp -P libsqlite3.so* /usr/local/lib/
sudo cp *.h /usr/local/include/
- name: Install extension dependencies
shell: docker-shell {0}
run: |
if [ "$USE_PREBUILT_QT" = 0 ]; then
sudo apt-get -y install libicu-dev libicu${{ matrix.icu_version_short }}
fi
sudo apt-get -y install zlib1g-dev
- name: Compile additional SQLite3 extensions
shell: docker-shell {0}
run: |
cd ..
mkdir ext
unzip sqlite-src-$SQLITE_VERSION.zip -x '*.test'
cd sqlite-src-$SQLITE_VERSION/ext
FLAGS="-ldl -Os -fpic -shared -Imisc -I/usr/local/include -L/usr/local/lib -lsqlite3"
for f in compress; do
echo "gcc misc/$f.c $FLAGS -lz -o ../../ext/$f.so"
gcc misc/$f.c $FLAGS -lz -o ../../ext/$f.so
done
for f in csv decimal eval ieee754 percentile rot13 series sqlar uint uuid zorder; do
echo "gcc misc/$f.c $FLAGS -o ../../ext/$f.so"
gcc misc/$f.c $FLAGS -o ../../ext/$f.so
done
for f in icu; do
ICU_FLAGS="$(pkg-config --libs --cflags icu-uc icu-io)"
echo "gcc icu/$f.c $ICU_FLAGS $FLAGS -o ../../ext/$f.so"
gcc icu/$f.c $ICU_FLAGS $FLAGS -o ../../ext/$f.so
done
ls -l ../../ext/
- name: Install other tools/dependencies
shell: docker-shell {0}
run: |
sudo apt install -y libreadline-dev libncurses5-dev patchelf chrpath
if [ $USE_PREBUILT_QT = 0 ]; then
echo "${{ github.workspace }}/../Qt/${{ matrix.qt_version }}/gcc_64/bin" >> $GITHUB_PATH
fi
- name: Prepare output dir
run: mkdir output output/build output/build/Plugins
- name: Compile SQLiteStudio3
shell: docker-shell {0}
working-directory: output/build
run: |
qmake \
$([ ${{ inputs.use_ccache || false }} = false ] || echo "CONFIG+=ccache") \
CONFIG+=portable \
../../SQLiteStudio3
make -j $(nproc)
- name: Compile Plugins
shell: docker-shell {0}
working-directory: output/build/Plugins
run: |
qmake \
$([ ${{ inputs.use_ccache || false }} = false ] || echo "CONFIG+=ccache") \
CONFIG+=portable \
PYTHON_VERSION=$PYTHON_VERSION "INCLUDEPATH+=$pythonLocation/include/python$PYTHON_VERSION" "LIBS += -L$pythonLocation/lib" \
../../../Plugins
make -j 1 # Parallel plugin build crashes randomly
- name: Copy SQLite extensions to output dir
shell: bash
run: |
cp -R ../ext output/SQLiteStudio/extensions
- name: Prepare portable dir
working-directory: output
run: |
mkdir portable
cp -R SQLiteStudio portable/
- name: Copy SQLite3 to portable dir
shell: docker-shell {0}
working-directory: ${{ env.PORTABLE_DIR }}
run: cp -P /usr/local/lib/libsqlite3.so* lib/
- name: Copy libtcl to portable dir
shell: docker-shell {0}
working-directory: ${{ env.PORTABLE_DIR }}
run: |
cp -P "/usr/local/lib/libtcl$TCL_VERSION_SHORT.so" lib/
chmod u+w "lib/libtcl$TCL_VERSION_SHORT.so"
- name: Copy SQLCipher's libcrypto to portable dir
shell: docker-shell {0}
working-directory: ${{ env.PORTABLE_DIR }}
run: |
set -x
LDD_OUTPUT="$(ldd plugins/libDbSqliteCipher.so | grep crypto || true)"
LIBCRYPTO=$(echo "$LDD_OUTPUT" | awk '{print $3}')
REAL_LIBCRYPTO=$(readlink -e $LIBCRYPTO)
cp -P $REAL_LIBCRYPTO lib/$(basename -- $LIBCRYPTO)
- name: Copy prebuilt OpenSSL to portable dir
if: env.USE_PREBUILT_QT == 1
shell: docker-shell {0}
working-directory: /usr/local/lib
run: |
cp libssl.so.3 libcrypto.so.3 $PORTABLE_DIR/lib/
- name: Copy Qt's libcrypto and libssl to portable dir (#4577)
if: env.USE_PREBUILT_QT == 0
run: |
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.22_amd64.deb
dpkg-deb -xv libssl1.1_1.1.1f-1ubuntu2.22_amd64.deb .
cp ./usr/lib/$TARGET_ARCH-linux-gnu/libssl.so.1.1 ${{ env.PORTABLE_DIR }}/lib/
cp ./usr/lib/$TARGET_ARCH-linux-gnu/libcrypto.so.1.1 ${{ env.PORTABLE_DIR }}/lib/
- name: Copy Qt to portable dir
shell: docker-shell {0}
working-directory: ${{ env.PORTABLE_DIR }}
run: |
cp -P ${{ env.Qt5_Dir }}/lib/libQt5Core.so* lib/
cp -P ${{ env.Qt5_Dir }}/lib/libQt5DBus.so* lib/
cp -P ${{ env.Qt5_Dir }}/lib/libQt5Concurrent.so* lib/
cp -P ${{ env.Qt5_Dir }}/lib/libQt5Gui.so* lib/
cp -P ${{ env.Qt5_Dir }}/lib/libQt5Network.so* lib/
cp -P ${{ env.Qt5_Dir }}/lib/libQt5PrintSupport.so* lib/
cp -P ${{ env.Qt5_Dir }}/lib/libQt5Qml.so* lib/
cp -P ${{ env.Qt5_Dir }}/lib/libQt5WaylandClient.so* lib/
cp -P ${{ env.Qt5_Dir }}/lib/libQt5Widgets.so* lib/
cp -P ${{ env.Qt5_Dir }}/lib/libQt5Xml.so* lib/
cp -P ${{ env.Qt5_Dir }}/lib/libQt5Svg.so* lib/
cp -P ${{ env.Qt5_Dir }}/lib/libQt5XcbQpa.so* lib/
cp -P ${{ env.Qt5_Dir }}/lib/libicui18n.so.$ICU_VERSION_SHORT* lib/
cp -P ${{ env.Qt5_Dir }}/lib/libicuuc.so.$ICU_VERSION_SHORT* lib/
cp -P ${{ env.Qt5_Dir }}/lib/libicudata.so.$ICU_VERSION_SHORT* lib/
- name: Copy Qt plugins to portable dir
shell: docker-shell {0}
working-directory: ${{ env.PORTABLE_DIR }}
run: |
mkdir platforms imageformats iconengines printsupport platformthemes platforminputcontexts
cp -P ${{ env.Qt5_Dir }}/plugins/platforms/libqwayland-generic.so platforms/libqwayland-generic.so
cp -P ${{ env.Qt5_Dir }}/plugins/platforms/libqxcb.so platforms/libqxcb.so
cp -P ${{ env.Qt5_Dir }}/plugins/imageformats/libqgif.so imageformats/libqgif.so
cp -P ${{ env.Qt5_Dir }}/plugins/imageformats/libqicns.so imageformats/libqicns.so
cp -P ${{ env.Qt5_Dir }}/plugins/imageformats/libqico.so imageformats/libqico.so
cp -P ${{ env.Qt5_Dir }}/plugins/imageformats/libqjpeg.so imageformats/libqjpeg.so
cp -P ${{ env.Qt5_Dir }}/plugins/imageformats/libqsvg.so imageformats/libqsvg.so
cp -P ${{ env.Qt5_Dir }}/plugins/imageformats/libqtga.so imageformats/libqtga.so
cp -P ${{ env.Qt5_Dir }}/plugins/imageformats/libqtiff.so imageformats/libqtiff.so
cp -P ${{ env.Qt5_Dir }}/plugins/iconengines/libqsvgicon.so iconengines/libqsvgicon.so
cp -P ${{ env.Qt5_Dir }}/plugins/printsupport/libcupsprintersupport.so printsupport/libcupsprintersupport.so
cp -P ${{ env.Qt5_Dir }}/plugins/platformthemes/libqgtk3.so platformthemes/libqgtk3.so
cp -P ${{ env.Qt5_Dir }}/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so platforminputcontexts/libcomposeplatforminputcontextplugin.so
- name: Copy extra Qt dependencies to portable dir
shell: docker-shell {0}
working-directory: ${{ env.PORTABLE_DIR }}
run: |
libdir=/usr/lib/$TARGET_ARCH-linux-gnu
if ldd lib/libQt5XcbQpa.so | grep -q libxcb-; then
# These are not installed by default on my Xubuntu 16.04:
cp -P $libdir/libxcb-icccm.so* lib/
cp -P $libdir/libxcb-image.so* lib/
cp -P $libdir/libxcb-keysyms.so* lib/
cp -P $libdir/libxcb-randr.so* lib/
cp -P $libdir/libxcb-render-util.so* lib/
cp -P $libdir/libxcb-xinerama.so* lib/
# These are not installed by default on my Xubuntu 22.04:
cp -P $libdir/libxcb-xkb.so* lib/
cp -P $libdir/libxkbcommon.so* lib/ # libxkbcommon _is_ installed by default but must match the version of
cp -P $libdir/libxkbcommon-x11.so* lib/ # libxkbcommon-x11 which is not
fi
if ldd lib/libQt5WaylandClient.so | grep -q libwayland-; then
# These must probably match the build system
cp -P $libdir/libwayland-client.so* lib/
cp -P $libdir/libwayland-cursor.so* lib/
cp -P $libdir/libffi.so* lib/
fi
- name: Fix dependency paths
shell: docker-shell {0}
working-directory: ${{ env.PORTABLE_DIR }}
run: |
set -x
chrpath -k -r \$ORIGIN/../lib platforms/*.so imageformats/*.so iconengines/*.so printsupport/*.so platformthemes/*.so plugins/*.so
chrpath -k -r \$ORIGIN lib/libicu*.*.* lib/libtcl$TCL_VERSION_SHORT.so
chrpath -k -r \$ORIGIN lib/libcoreSQLiteStudio.so lib/libguiSQLiteStudio.so
chrpath -k -r \$ORIGIN/lib sqlitestudio
chrpath -k -r \$ORIGIN/lib sqlitestudiocli
chrpath -l platforms/*.so imageformats/*.so iconengines/*.so printsupport/*.so platformthemes/*.so plugins/*.so
chrpath -l lib/libicu*.*.* lib/libtcl$TCL_VERSION_SHORT.so
chrpath -l lib/libcoreSQLiteStudio.so lib/libguiSQLiteStudio.so
chrpath -l sqlitestudio
chrpath -l sqlitestudiocli
- name: Final preparations for packaging, copying app icon assets
run: |
mkdir "${{ env.PORTABLE_DIR }}"/assets
cp SQLiteStudio3/guiSQLiteStudio/img/sqlitestudio_256.png "${{ env.PORTABLE_DIR }}"/assets/appicon.png
cp SQLiteStudio3/guiSQLiteStudio/img/sqlitestudio.svg "${{ env.PORTABLE_DIR }}"/assets/appicon.svg
- name: Final preparations for packaging
shell: docker-shell {0}
working-directory: ${{ env.PORTABLE_DIR }}
run: |
cp `ldd sqlitestudiocli | grep readline | awk '{print $3}'` lib/
cp `ldd lib/libreadline* | grep tinfo | awk '{print $3}'` lib/
# strip does not like binaries processed by patchelf, so strip first
strip lib/*.so sqlitestudio sqlitestudiocli platforms/*.so imageformats/*.so iconengines/*.so printsupport/*.so platformthemes/*.so plugins/*.so
# These may have no initial rpath/runpath so chrpath does not work on them
patchelf --set-rpath '$ORIGIN' \
lib/libQt5Core.so.*.*.* \
lib/libreadline* \
lib/libwayland-c*.so.*.*.*
- name: Determine SQLiteStudio version
shell: docker-shell {0}
working-directory: ${{ env.PORTABLE_DIR }}
run: |
SQLITESTUDIO_VERSION="$(./sqlitestudiocli --version | cut -f 2 -d ' ')"
[ -n "$SQLITESTUDIO_VERSION" ] || exit 1
echo "SQLITESTUDIO_VERSION=$SQLITESTUDIO_VERSION" >> $GITHUB_ENV
echo "PACKAGE_VERSION=$SQLITESTUDIO_VERSION-qt${{ matrix.qt_version }}-linux_${{ matrix.binary_compatibility }}.$TARGET_ARCH" >> $GITHUB_ENV
- name: Assemble portable package
shell: bash
working-directory: ${{ env.PORTABLE_DIR }}/..
run: |
tar cf - SQLiteStudio | xz > sqlitestudio-$PACKAGE_VERSION.tar.xz
pwd
ls -l
- name: Create installer package
shell: docker-shell {0}
env:
IB_LICENSE: ${{ secrets.INSTALLER_LICENSE }}
run: |
echo "$IB_LICENSE" > lic.xml
${{ env.INSTALLBUILDER_DIR }}/bin/builder build SQLiteStudio-installer.xml \
--license lic.xml \
--setvars project.outputDirectory=$(pwd) \
--setvars project.version=$SQLITESTUDIO_VERSION
ls -l
mv SQLiteStudio-${{ env.SQLITESTUDIO_VERSION }}-linux-x64-installer.run \
SQLiteStudio-$PACKAGE_VERSION-installer.run
- name: Upload package artifact
uses: actions/upload-artifact@v4
with:
name: sqlitestudio-${{ env.PACKAGE_VERSION }}.tar.xz
path: output/portable/sqlitestudio-${{ env.PACKAGE_VERSION }}.tar.xz
- name: Upload installer artifact
uses: actions/upload-artifact@v4
with:
name: SQLiteStudio-${{ env.PACKAGE_VERSION }}-installer.run
path: SQLiteStudio-${{ env.PACKAGE_VERSION }}-installer.run