Linux release build #505
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env: | |
TARGET_ARCH: 'x86_64' | |
QT_VERSION: '6.5.3' | |
TCL_VERSION: '8.6' | |
SQLITE_VERSION: '3470200' | |
PYTHON_VERSION: '3.13' | |
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 | |
LIBSSL_DIR_URL: http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/ | |
LIBSSL_DEB: libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
name: Linux release build | |
on: | |
workflow_dispatch: | |
inputs: | |
use_ccache: | |
description: 'Use ccache (for workflow debugging only!)' | |
required: false | |
type: boolean | |
DEBUG: | |
description: 'Enable workflow debug messages' | |
required: false | |
type: boolean | |
default: false | |
schedule: | |
- cron: '30 3 * * 1' # run at 3:30 AM UTC every Monday | |
repository_dispatch: | |
types: [lin_release] | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
architecture: 'x64' | |
- name: Qt installation dir | |
id: qt-installation-dir | |
run: echo "DIR=$(readlink -f ${{ github.workspace }}/..)" >> $GITHUB_OUTPUT | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v4 | |
with: | |
cache: true | |
version: ${{ env.QT_VERSION }} | |
host: 'linux' | |
dir: '${{ steps.qt-installation-dir.DIR }}' | |
setup-python: 'false' | |
extra: '--external 7z' | |
modules: 'qtimageformats' | |
- name: Clone GH scripts | |
uses: actions/checkout@v3 | |
with: | |
repository: pawelsalawa/gh-action-scripts | |
ref: main | |
path: gh-scripts | |
- name: Setup GH scripts path | |
shell: bash | |
run: | | |
mv gh-scripts .. | |
cd .. | |
chmod +x gh-scripts/scripts/*.sh | |
echo "GH_SCRIPTS=$(pwd)/gh-scripts/scripts" >> $GITHUB_ENV | |
echo "DEBUG=${{ inputs.DEBUG }}" >> $GITHUB_ENV | |
- name: Install the InstalBuilder | |
shell: bash | |
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: Clone repo | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.BRANCH_NAME }} | |
- name: Pre-download SQLite vanilla sourcecode | |
shell: bash | |
run: | | |
SQLITE_DOT_VERSION=$($GH_SCRIPTS/convert_int_ver.sh $SQLITE_VERSION) | |
echo "SQLITE_DOT_VERSION=$SQLITE_DOT_VERSION" >> $GITHUB_ENV | |
cd .. | |
curl -L https://github.com/pawelsalawa/sqlite3-sqls/releases/download/v$SQLITE_DOT_VERSION/sqlite3-extensions-src-$SQLITE_VERSION.zip --output sqlite3-extensions-src-$SQLITE_VERSION.zip | |
mkdir ext-src | |
unzip sqlite3-extensions-src-$SQLITE_VERSION.zip -d ext-src | |
- name: Prepare ccache | |
if: inputs.use_ccache || false | |
uses: hendrikmuhs/ccache-action@v1.2.8 | |
with: | |
key: lin_release | |
max-size: "24M" | |
- name: Configure ccache | |
if: inputs.use_ccache || false | |
run: | | |
echo "PATH=/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" >> $GITHUB_ENV | |
- name: Install SQLite3 | |
run: | | |
cd .. | |
SQLITE3_ZIP=sqlite3-linux-x64-$SQLITE_VERSION.zip | |
curl -L https://github.com/pawelsalawa/sqlite3-sqls/releases/download/v$SQLITE_DOT_VERSION/$SQLITE3_ZIP --output $SQLITE3_ZIP | |
sudo rm -f /usr/lib/libsqlite* /usr/local/lib/libsqlite* /usr/include/sqlite* /usr/local/include/sqlite* /usr/lib/x86_64-linux-gnu/libsqlite* | |
sudo unzip $SQLITE3_ZIP libsqlite3.so -d /usr/local/lib | |
sudo unzip $SQLITE3_ZIP sqlite3.h sqlite3ext.h -d /usr/local/include | |
sudo ln -s /usr/local/lib/libsqlite3.so /usr/local/lib/libsqlite3.so.0 | |
sudo ln -s /usr/local/lib/libsqlite3.so /usr/local/lib/libsqlite3.so.0.8.6 | |
ls -l /usr/local/lib/libsqlite3* | |
ls -l /usr/local/include/sqlite* | |
- name: Compile additional SQLite3 extensions | |
shell: bash | |
run: | | |
cd .. | |
mkdir ext | |
cd ext-src | |
FLAGS="-ldl -Os -fpic -shared -Imisc -I/usr/local/include -L/usr/local/lib -lsqlite3" | |
set -x | |
for f in compress; do | |
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 | |
gcc misc/$f.c $FLAGS -o ../ext/$f.so | |
done | |
for f in icu; do | |
gcc icu/$f.c $FLAGS `pkg-config --libs --cflags icu-uc icu-io` -o ../ext/$f.so | |
done | |
set +x | |
ls -l ../ext/ | |
- name: Install Tcl | |
run: sudo apt-get install -qq libtcl$TCL_VERSION tcl$TCL_VERSION-dev | |
- name: Install other tools/dependencies | |
run: | | |
sudo apt install libreadline-dev libncurses5-dev patchelf chrpath | |
echo "${{ github.workspace }}/../Qt/${{ env.QT_VERSION }}/gcc_64/bin" >> $GITHUB_PATH | |
- name: Prepare output dir | |
run: mkdir output output/build output/build/Plugins | |
- name: Compile SQLiteStudio3 | |
working-directory: output/build | |
run: | | |
qmake \ | |
$([ ${{ inputs.use_ccache || false }} = false ] || echo "CONFIG+=ccache") \ | |
CONFIG+=portable \ | |
../../SQLiteStudio3 | |
make -j 4 | |
- name: Compile Plugins | |
working-directory: output/build/Plugins | |
run: | | |
qmake \ | |
$([ ${{ inputs.use_ccache || false }} = false ] || echo "CONFIG+=ccache") \ | |
CONFIG+=portable \ | |
"INCLUDEPATH+=$pythonLocation/include/python$PYTHON_VERSION" "LIBS += -L$pythonLocation/lib" \ | |
../../../Plugins | |
make -j 1 | |
- 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 | |
working-directory: ${{ env.PORTABLE_DIR }} | |
run: cp -P /usr/local/lib/libsqlite3.so* lib/ | |
- name: Copy SQLCipher's libcrypto to portable dir | |
working-directory: ${{ env.PORTABLE_DIR }} | |
run: | | |
LIBCRYPTO=$(ldd plugins/libDbSqliteCipher.so | grep crypto | awk '{print $3}') | |
REAL_LIBCRYPTO=$(readlink -e $LIBCRYPTO) | |
cp -P $REAL_LIBCRYPTO lib/$(basename -- $LIBCRYPTO) | |
- name: Copy Qt's libcrypto and libssl to portable dir (#4577) | |
run: | | |
wget ${{ env.LIBSSL_DIR_URL }}${{ env.LIBSSL_DEB }} | |
dpkg-deb -xv ${{ env.LIBSSL_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 | |
working-directory: ${{ env.PORTABLE_DIR }} | |
run: | | |
cp -P ${{ env.QT_ROOT_DIR }}/lib/libQt6Core.so* lib/ | |
cp -P ${{ env.QT_ROOT_DIR }}/lib/libQt6DBus.so* lib/ | |
cp -P ${{ env.QT_ROOT_DIR }}/lib/libQt6Concurrent.so* lib/ | |
cp -P ${{ env.QT_ROOT_DIR }}/lib/libQt6Gui.so* lib/ | |
cp -P ${{ env.QT_ROOT_DIR }}/lib/libQt6Network.so* lib/ | |
cp -P ${{ env.QT_ROOT_DIR }}/lib/libQt6PrintSupport.so* lib/ | |
cp -P ${{ env.QT_ROOT_DIR }}/lib/libQt6Qml.so* lib/ | |
cp -P ${{ env.QT_ROOT_DIR }}/lib/libQt6Wayland*Client*.so* lib/ | |
cp -P ${{ env.QT_ROOT_DIR }}/lib/libQt6Widgets.so* lib/ | |
cp -P ${{ env.QT_ROOT_DIR }}/lib/libQt6Xml.so* lib/ | |
cp -P ${{ env.QT_ROOT_DIR }}/lib/libQt6Svg.so* lib/ | |
cp -P ${{ env.QT_ROOT_DIR }}/lib/libQt6XcbQpa.so* lib/ | |
cp -P ${{ env.QT_ROOT_DIR }}/lib/libQt6OpenGL.so* lib/ | |
cp -P ${{ env.QT_ROOT_DIR }}/lib/libQt6OpenGLWidgets.so* lib/ | |
cp -P ${{ env.QT_ROOT_DIR }}/lib/libQt6UiTools.so* lib/ | |
cp -P ${{ env.QT_ROOT_DIR }}/lib/libicui18n.so* lib/ | |
cp -P ${{ env.QT_ROOT_DIR }}/lib/libicuuc.so* lib/ | |
cp -P ${{ env.QT_ROOT_DIR }}/lib/libicudata.so* lib/ | |
- name: Copy Qt plugins to portable dir | |
working-directory: ${{ env.PORTABLE_DIR }} | |
run: | | |
mkdir platforms imageformats iconengines printsupport platformthemes platforminputcontexts wayland-decoration-client wayland-graphics-integration-client wayland-shell-integration tls | |
cp -P ${{ env.QT_ROOT_DIR }}/plugins/platforms/libqxcb.so platforms/libqxcb.so | |
cp -P ${{ env.QT_ROOT_DIR }}/plugins/platforms/libqwayland-*.so platforms/ | |
for f in qgif qicns qico qjpeg qsvg qtga qtiff qwbmp qwebp; do | |
cp -P ${{ env.QT_ROOT_DIR }}/plugins/imageformats/lib$f.so imageformats/lib$f.so | |
done | |
cp -P ${{ env.QT_ROOT_DIR }}/plugins/iconengines/libqsvgicon.so iconengines/libqsvgicon.so | |
cp -P ${{ env.QT_ROOT_DIR }}/plugins/printsupport/libcupsprintersupport.so printsupport/libcupsprintersupport.so | |
cp -P ${{ env.QT_ROOT_DIR }}/plugins/platformthemes/libqgtk3.so platformthemes/libqgtk3.so | |
cp -P ${{ env.QT_ROOT_DIR }}/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so platforminputcontexts/libcomposeplatforminputcontextplugin.so | |
cp -P ${{ env.QT_ROOT_DIR }}/plugins/wayland-decoration-client/*.so wayland-decoration-client/ | |
cp -P ${{ env.QT_ROOT_DIR }}/plugins/wayland-graphics-integration-client/*.so wayland-graphics-integration-client/ | |
cp -P ${{ env.QT_ROOT_DIR }}/plugins/wayland-shell-integration/*.so wayland-shell-integration/ | |
cp -P ${{ env.QT_ROOT_DIR }}/plugins/tls/libqopensslbackend.so tls/ | |
- name: Copy extra Qt dependencies to portable dir | |
shell: bash | |
working-directory: ${{ env.PORTABLE_DIR }} | |
run: | | |
libdir=/usr/lib/$TARGET_ARCH-linux-gnu | |
if ldd lib/libQt${QT_VERSION_MAJ}XcbQpa.so | grep -q libxcb-; then | |
# These are not installed by default on 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/libQt${QT_VERSION_MAJ}WaylandClient.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 | |
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 wayland-*/*.so tls/*.so 2>&1 >/dev/null | |
chrpath -k -r \$ORIGIN lib/libicu*.*.* | |
chrpath -k -r \$ORIGIN lib/libcoreSQLiteStudio.so lib/libguiSQLiteStudio.so 2>&1 >/dev/null | |
chrpath -k -r \$ORIGIN/lib sqlitestudio 2>&1 >/dev/null | |
chrpath -k -r \$ORIGIN/lib sqlitestudiocli 2>&1 >/dev/null | |
chrpath -l platforms/*.so imageformats/*.so iconengines/*.so printsupport/*.so platformthemes/*.so plugins/*.so | |
chrpath -l lib/libicu*.*.* | |
chrpath -l lib/libcoreSQLiteStudio.so lib/libguiSQLiteStudio.so | |
chrpath -l sqlitestudio | |
chrpath -l sqlitestudiocli | |
- name: Final preparations for packaging | |
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 | |
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 lib/*.so sqlitestudio sqlitestudiocli platforms/*.so imageformats/*.so iconengines/*.so printsupport/*.so platformthemes/*.so plugins/*.so tls/*.so | |
# These may have no initial rpath/runpath so chrpath does not work on them | |
patchelf --set-rpath '$ORIGIN' \ | |
lib/libQt6Core.so.*.*.* \ | |
lib/libreadline* | |
- name: Determine SQLiteStudio version | |
working-directory: ${{ env.PORTABLE_DIR }} | |
run: | | |
SQLITESTUDIO_VERSION=$(./sqlitestudiocli --version | cut -f 2 -d ' ') | |
echo "SQLITESTUDIO_VERSION=$SQLITESTUDIO_VERSION" >> $GITHUB_ENV | |
echo "PACKAGE_VERSION=${SQLITESTUDIO_VERSION}-linux-x64" >> $GITHUB_ENV | |
- name: Assemble portable package | |
shell: bash | |
working-directory: ${{ env.PORTABLE_DIR }}/.. | |
run: | | |
tar cf sqlitestudio-$PACKAGE_VERSION.tar SQLiteStudio | |
xz -z sqlitestudio-$PACKAGE_VERSION.tar | |
pwd | |
ls -l | |
- name: Create installer package | |
shell: bash | |
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 | |
- name: SHA256 checksums | |
shell: bash | |
run: | | |
sha256sum output/portable/sqlitestudio-${{ env.PACKAGE_VERSION }}.tar.xz | |
sha256sum SQLiteStudio-${{ env.SQLITESTUDIO_VERSION }}-linux-x64-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.SQLITESTUDIO_VERSION }}-linux-x64-installer.run | |
path: SQLiteStudio-${{ env.SQLITESTUDIO_VERSION }}-linux-x64-installer.run |