aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/lin_release.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/lin_release.yml')
-rw-r--r--.github/workflows/lin_release.yml167
1 files changed, 167 insertions, 0 deletions
diff --git a/.github/workflows/lin_release.yml b/.github/workflows/lin_release.yml
new file mode 100644
index 0000000..b95453c
--- /dev/null
+++ b/.github/workflows/lin_release.yml
@@ -0,0 +1,167 @@
+env:
+ QT_VERSION: '5.15.2'
+ TCL_VERSION: '8.6'
+ SQLITE_VERSION: '3350400'
+ SQLITE_RELEASE_YEAR: '2021'
+ PORTABLE_DIR: ${{ github.workspace }}/output/portable/SQLiteStudio
+
+name: Linux release build
+
+on:
+ repository_dispatch:
+ types: [lin_release]
+
+jobs:
+ build:
+ runs-on: ubuntu-18.04
+
+ steps:
+ - name: Cache Qt
+ id: cache-qt
+ uses: actions/cache@v1
+ with:
+ path: ${{ github.workspace }}/../Qt
+ key: ${{ runner.os }}-Qt-${{ env.QT_VERSION }}-Linux-Cache
+
+ - name: Install Qt
+ uses: jurplel/install-qt-action@v2
+ with:
+ cached: ${{ steps.cache-qt.outputs.cache-hit }}
+ version: ${{ env.QT_VERSION }}
+ host: 'linux'
+ dir: '${{ github.workspace }}/..'
+ modules: 'qtscript'
+
+ - name: Clone repo
+ uses: actions/checkout@v2
+ with:
+ ref: ${{ github.event.client_payload.branch }}
+
+ - name: Install SQLite3
+ run: |
+ sudo rm -f /usr/lib/libsqlite* /usr/local/lib/libsqlite* /usr/include/sqlite* /usr/local/include/sqlite* /usr/lib/x86_64-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 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
+ 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 CONFIG+=portable ../../SQLiteStudio3
+ make -j 2
+
+ - name: Compile Plugins
+ working-directory: output/build/Plugins
+ run: |
+ qmake CONFIG+=portable ../../../Plugins
+ make -j 2
+
+ - 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 Qt to portable dir
+ 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/libQt5Script.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* lib/
+ cp -P ${{ env.Qt5_Dir }}/lib/libicuuc.so* lib/
+ cp -P ${{ env.Qt5_Dir }}/lib/libicudata.so* lib/
+
+ - name: Copy Qt plugins to portable dir
+ working-directory: ${{ env.PORTABLE_DIR }}
+ run: |
+ mkdir platforms imageformats iconengines printsupport platformthemes
+ 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
+
+ - name: Fix dependency paths
+ working-directory: ${{ env.PORTABLE_DIR }}
+ run: |
+ chrpath -k -r \$ORIGIN/../lib platforms/*.so imageformats/*.so iconengines/*.so printsupport/*.so platformthemes/*.so plugins/*.so 2>&1 >/dev/null
+ 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/libcoreSQLiteStudio.so lib/libguiSQLiteStudio.so
+ chrpath -l sqlitestudio
+ chrpath -l sqlitestudiocli
+
+ - 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
+ patchelf --set-rpath '$ORIGIN' lib/libreadline*
+
+ - name: Determine SQLiteStudio version
+ working-directory: ${{ env.PORTABLE_DIR }}
+ run: echo "SQLITESTUDIO_VERSION=$(./sqlitestudiocli --version | cut -f 2 -d ' ')" >> $GITHUB_ENV
+
+ - name: Assemble portable package
+ shell: bash
+ working-directory: ${{ env.PORTABLE_DIR }}/..
+ run: |
+ tar cf sqlitestudio-$SQLITESTUDIO_VERSION.tar SQLiteStudio
+ xz -z sqlitestudio-$SQLITESTUDIO_VERSION.tar
+ pwd
+ ls -l
+
+ - name: Upload package artifact
+ uses: actions/upload-artifact@v1
+ with:
+ name: sqlitestudio-${{ env.SQLITESTUDIO_VERSION }}.tar.xz
+ path: output/portable/sqlitestudio-${{ env.SQLITESTUDIO_VERSION }}.tar.xz