Windows 32-bit release build #403
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: | |
QT_VERSION: '5.15.2' | |
SQLITE_VERSION: '3470100' | |
SQLITE_RELEASE_YEAR: '2024' | |
QT_ARCH: 'win32_mingw81' | |
PYTHON_VERSION: '3.9' | |
ICU_VER: '75' | |
ICU_URL: https://mirror.msys2.org/mingw/mingw32/mingw-w64-i686-icu-75.1-2-any.pkg.tar.zst | |
PORTABLE_DIR: output/portable/SQLiteStudio | |
INSTALLBUILDER_DIR: ../ib | |
MINGW_URL: https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/tools_mingw/qt.tools.win32_mingw810/8.1.0-1-202004170606i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z | |
INSTALLBUILDER_URL: https://releases.installbuilder.com/installbuilder/installbuilder-enterprise-24.3.0-windows-installer.exe | |
name: Windows 32-bit release build | |
on: | |
workflow_dispatch: | |
inputs: | |
use_ccache: | |
description: 'Use ccache (for workflow debugging only!)' | |
required: false | |
type: boolean | |
schedule: | |
- cron: '30 2 * * 1' # run at 2 AM UTC every Monday | |
repository_dispatch: | |
types: [win32_release] | |
jobs: | |
build: | |
runs-on: windows-2019 | |
strategy: | |
fail-fast: false | |
matrix: | |
qt_version: | |
- "5.15.2" | |
- "5.15.14" | |
#- "6.7.2" # No Qt 6 for 32-bit | |
steps: | |
- name: Configure environment | |
shell: bash | |
run: | | |
{ | |
case ${{ matrix.qt_version }} in | |
5.15.2) echo QT_FROM_PACKAGES=0 | |
echo QT_ARCH=win32_mingw81 ;; | |
*) echo QT_FROM_PACKAGES=1 ;; | |
esac | |
TARGET_ARCH=i686 | |
case ${{ matrix.qt_version }} in | |
5.*) echo QT_VERSION_MAJ=5 | |
echo QMAKE_COMMAND="qmake.exe QMAKE_CXXFLAGS+=-m32" | |
echo QT_ADD_PACKAGES="mingw-w64-$TARGET_ARCH-qt5-winextras" | |
;; | |
6.*) echo QT_VERSION_MAJ=6 | |
echo QMAKE_COMMAND=qmake6.exe | |
echo QT_ADD_PACKAGES="mingw-w64-$TARGET_ARCH-qt6-5compat" | |
;; | |
esac | |
echo TARGET_ARCH=$TARGET_ARCH | |
echo MINGWxx=mingw32 | |
echo CCACHE_COMMAND="$HOME/.cargo/bin/ccache.exe" | |
} >> $GITHUB_ENV | |
- uses: msys2/setup-msys2@v2 | |
if: env.QT_FROM_PACKAGES == 1 | |
with: | |
msystem: MINGW32 | |
location: d:/ | |
install: > | |
mingw-w64-${{ env.TARGET_ARCH }}-gcc | |
mingw-w64-${{ env.TARGET_ARCH }}-make | |
mingw-w64-${{ env.TARGET_ARCH }}-qt${{ env.QT_VERSION_MAJ }}-base | |
mingw-w64-${{ env.TARGET_ARCH }}-qt${{ env.QT_VERSION_MAJ }}-declarative | |
mingw-w64-${{ env.TARGET_ARCH }}-qt${{ env.QT_VERSION_MAJ }}-imageformats | |
mingw-w64-${{ env.TARGET_ARCH }}-qt${{ env.QT_VERSION_MAJ }}-svg | |
mingw-w64-${{ env.TARGET_ARCH }}-qt${{ env.QT_VERSION_MAJ }}-tools | |
${{ env.QT_ADD_PACKAGES }} | |
mingw-w64-${{ env.TARGET_ARCH }}-wineditline | |
unzip | |
update: ${{ env.QT_FROM_PACKAGES == 1 }} | |
- name: Configure shell | |
run: | | |
mkdir "$env:USERPROFILE/bin" -ea 0 | |
echo "$env:USERPROFILE/bin" >> $env:GITHUB_PATH | |
if ( "$env:QT_FROM_PACKAGES" -eq 1 ) { | |
echo '@msys2.cmd %*' > "$env:USERPROFILE/bin/bash_or_msys2.cmd" | |
} else { | |
echo '@bash -eo pipefail %*' > "$env:USERPROFILE/bin/bash_or_msys2.cmd" | |
} | |
- name: Configure Qt from packages | |
if: env.QT_FROM_PACKAGES == 1 | |
shell: msys2 {0} | |
run: | | |
set -x | |
qt_version_local="$(pacman -Si mingw-w64-$TARGET_ARCH-qt${{ env.QT_VERSION_MAJ }}-base | awk '/Version/ {print $3}')" | |
case "$qt_version_local" in | |
${{ matrix.qt_version }}*) ;; | |
*) echo "Repos have $qt_version_local, can't install ${{ matrix.qt_version }} from repos"; exit 1 ;; | |
esac | |
if [ "$QT_VERSION_MAJ" = 6 ]; then | |
for tool in lrelease; do | |
ln /d/msys64/$MINGWxx/bin/$tool-qt6.exe /d/msys64/$MINGWxx/bin/$tool.exe | |
done | |
fi | |
echo 'd:\msys64\$MINGWxx\bin' >> $GITHUB_PATH | |
tee -a $GITHUB_ENV <<EOF_ENV | |
ICU_FLAGS=-licuio -licuin -licuuc -licudt | |
ICU_LIBDIR=/d/msys64/$MINGWxx/bin | |
QMAKE_EXTRA_FLAGS=INCLUDEPATH+=D:/msys64/$MINGWxx/include/editline | |
QT5_LIBDIR=/d/msys64/$MINGWxx/bin | |
QT5_PLUGINDIR=/d/msys64/$MINGWxx/share/qt${{ env.QT_VERSION_MAJ }}/plugins | |
ZLIB_FLAGS=-lz | |
EOF_ENV | |
- name: Set up MinGW | |
if: env.QT_FROM_PACKAGES == 0 | |
uses: egor-tensin/setup-mingw@v2 | |
with: | |
platform: x86 | |
version: 8.1.0 | |
- name: Cache Qt | |
if: env.QT_FROM_PACKAGES == 0 | |
id: cache-qt | |
uses: actions/cache@v3 | |
with: | |
path: ${{ github.workspace }}\..\Qt | |
key: ${{ runner.os }}-${{ matrix.qt_version }}-Qt-Cache | |
- name: Install Qt | |
if: env.QT_FROM_PACKAGES == 0 | |
uses: jurplel/install-qt-action@v3 | |
with: | |
cache: true | |
version: ${{ matrix.qt_version }} | |
host: 'windows' | |
arch: ${{ env.QT_ARCH }} | |
# jurplel/install-qt-action has a bug due to which we cannot use ${{ github.workspace }} for the "dir" property, because it will fail. | |
dir: 'D:/' | |
setup-python: 'false' | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
architecture: 'x86' | |
- name: Clone repo | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.client_payload.branch }} | |
- name: Install dependencies | |
if: env.QT_FROM_PACKAGES == 0 | |
shell: bash | |
run: | | |
7z x -o".." win_deps/win32_deps.zip | |
echo "../lib" >> $GITHUB_PATH | |
- name: Prepare ccache using action | |
if: inputs.use_ccache || false | |
uses: hendrikmuhs/[email protected] | |
with: | |
key: win32-qt${{ matrix.qt_version }}-release | |
max-size: "24M" | |
- name: Configure ccache (or not ccache) | |
shell: bash_or_msys2 {0} | |
run: | | |
if [ ${{ inputs.use_ccache || false }} = false ]; then | |
echo GCC_COMMAND="$(which gcc.exe)" | |
echo GXX_COMMAND="$(which g++.exe)" | |
else | |
echo GCC_COMMAND="$CCACHE_COMMAND gcc.exe" | |
echo GXX_COMMAND="$CCACHE_COMMAND g++.exe" | |
fi >> $GITHUB_ENV | |
- name: Install SQLite3 | |
shell: bash_or_msys2 {0} | |
run: | | |
set -x | |
cd .. | |
curl -L http://sqlite.org/$SQLITE_RELEASE_YEAR/sqlite-amalgamation-$SQLITE_VERSION.zip --output sqlite-amalgamation-$SQLITE_VERSION.zip | |
unzip sqlite-amalgamation-$SQLITE_VERSION.zip | |
cd sqlite-amalgamation-$SQLITE_VERSION | |
$GCC_COMMAND sqlite3.c -Os -fpic -DWIN32 -m32 -I. -shared -o sqlite3.dll \ | |
-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 | |
mkdir -p ../lib ../include | |
cp -f sqlite3.dll ../lib/ | |
cp -f sqlite3.h ../include/ | |
cp -f sqlite3ext.h ../include/ | |
- name: Install extension dependencies | |
if: env.QT_FROM_PACKAGES == 0 | |
shell: bash | |
run: | | |
cd .. | |
curl -L "$ICU_URL" | tar -xf - --zstd | |
mv mingw32 icu | |
tee -a $GITHUB_ENV <<EOF_ENV | |
ICU_FLAGS=-I$(pwd)/icu/include -L$(pwd)/icu/lib -licuio -licuin -licuuc -licudt | |
ICU_LIBDIR=$(pwd)/icu/bin | |
QT5_LIBDIR=$Qt5_Dir/bin | |
QT5_PLUGINDIR=$Qt5_Dir/plugins | |
ZLIB_FLAGS=-lzlib1 | |
EOF_ENV | |
- name: Compile additional SQLite3 extensions | |
shell: bash_or_msys2 {0} | |
run: | | |
cd .. | |
mkdir ext | |
curl -L http://sqlite.org/$SQLITE_RELEASE_YEAR/sqlite-src-$SQLITE_VERSION.zip --output sqlite-src-$SQLITE_VERSION.zip | |
unzip sqlite-src-$SQLITE_VERSION.zip | |
cd sqlite-src-$SQLITE_VERSION/ext | |
FLAGS="-shared -Os -fpic -DWIN32 -m32 -I../../include -L../../lib -lsqlite3" | |
for f in compress sqlar; do | |
echo "$GCC_COMMAND misc/$f.c -Imisc $ZLIB_FLAGS $FLAGS -o ../../ext/$f.dll" | |
$GCC_COMMAND misc/$f.c -Imisc $ZLIB_FLAGS $FLAGS -o ../../ext/$f.dll | |
done | |
# Bugfix for #5145. The percentile extension was fixed, but the fix is not included in SQLite 3.47.1 source package. | |
rm -f misc/percentile.c | |
curl -L https://sqlite.org/src/raw/82531c62cd015b9cdca95ad6bb10c3a907ceb570d21ebd4fb7d634c809cfb089?at=percentile.c --output misc/percentile.c | |
for f in csv decimal eval ieee754 percentile rot13 series uint uuid zorder; do | |
echo "$GCC_COMMAND misc/$f.c -Imisc $FLAGS -o ../../ext/$f.dll" | |
$GCC_COMMAND misc/$f.c -Imisc $FLAGS -o ../../ext/$f.dll | |
done | |
for f in icu; do | |
echo "$GCC_COMMAND icu/$f.c $ICU_FLAGS $FLAGS -o ../../ext/$f.dll" | |
$GCC_COMMAND icu/$f.c $ICU_FLAGS $FLAGS -o ../../ext/$f.dll | |
done | |
ls -l ../../ext/ | |
- name: Prepare output dir | |
shell: bash | |
run: mkdir output output/build output/build/Plugins | |
- name: Compile SQLiteStudio3 | |
working-directory: output/build | |
shell: bash_or_msys2 {0} | |
run: | | |
${{ env.QMAKE_COMMAND }} \ | |
CONFIG+=portable \ | |
"QMAKE_CXX=${{ env.GXX_COMMAND }}" \ | |
$QMAKE_EXTRA_FLAGS \ | |
../../SQLiteStudio3 | |
mingw32-make.exe -j 2 | |
- name: Compile Plugins | |
working-directory: output/build/Plugins | |
shell: bash_or_msys2 {0} | |
run: | | |
${{ env.QMAKE_COMMAND }} \ | |
"QMAKE_CXX=${{ env.GXX_COMMAND }}" \ | |
CONFIG+=portable \ | |
"INCLUDEPATH+=${{ env.pythonLocation }}/include" \ | |
../../../Plugins | |
mingw32-make.exe -j 1 | |
- name: Copy SQLite extensions to output dir | |
shell: bash | |
run: | | |
cp -R ../ext output/SQLiteStudio/ | |
- name: Prepare portable dir | |
shell: bash | |
working-directory: output | |
run: | | |
mkdir portable | |
cp -R SQLiteStudio portable/ | |
- name: Clean-up portable dir | |
shell: bash | |
run: | | |
cd ${{ env.PORTABLE_DIR }} | |
rm -f *.a | |
rm -f plugins/*.a | |
rm -f styles/*.a | |
echo "ABSOLUTE_PORTABLE_DIR=`pwd`" >> $GITHUB_ENV | |
- name: Prepare portable distro (Qt) | |
shell: bash | |
run: | | |
cd "$QT5_LIBDIR" | |
cp \ | |
Qt${QT_VERSION_MAJ}Core.dll \ | |
Qt${QT_VERSION_MAJ}Gui.dll \ | |
Qt${QT_VERSION_MAJ}Network.dll \ | |
Qt${QT_VERSION_MAJ}PrintSupport.dll \ | |
Qt${QT_VERSION_MAJ}Qml.dll \ | |
Qt${QT_VERSION_MAJ}Svg.dll \ | |
Qt${QT_VERSION_MAJ}Widgets.dll \ | |
Qt${QT_VERSION_MAJ}Xml.dll \ | |
libgcc_s_dw2-1.dll \ | |
libstdc++-6.dll \ | |
libwinpthread-1.dll \ | |
"$ABSOLUTE_PORTABLE_DIR" | |
if [ "$QT_VERSION_MAJ" = 6 ]; then | |
cp \ | |
Qt6Core5Compat.dll \ | |
Qt6OpenGL.dll \ | |
Qt6OpenGLWidgets.dll \ | |
Qt6UiTools.dll \ | |
"$ABSOLUTE_PORTABLE_DIR" | |
fi | |
if [ "$QT_FROM_PACKAGES" = 1 ]; then | |
cp \ | |
libbrotlicommon.dll \ | |
libbrotlidec.dll \ | |
libbz2-1.dll \ | |
libdouble-conversion.dll \ | |
libfreetype-6.dll \ | |
libglib-2.0-0.dll \ | |
libgraphite2.dll \ | |
libharfbuzz-0.dll \ | |
libiconv-2.dll \ | |
libintl-8.dll \ | |
libmd4c.dll \ | |
libpcre2-8-0.dll \ | |
libpcre2-16-0.dll \ | |
libpng16-16.dll \ | |
libzstd.dll \ | |
zlib1.dll \ | |
"$ABSOLUTE_PORTABLE_DIR" | |
case "$QT_VERSION_MAJ" in | |
6) cp \ | |
libb2-1.dll \ | |
"$ABSOLUTE_PORTABLE_DIR" ;; | |
esac | |
else | |
cp qt.conf "$ABSOLUTE_PORTABLE_DIR" | |
fi | |
cd "$QT5_PLUGINDIR" | |
mkdir -p "$ABSOLUTE_PORTABLE_DIR/iconengines" | |
mkdir -p "$ABSOLUTE_PORTABLE_DIR/platforms" | |
mkdir -p "$ABSOLUTE_PORTABLE_DIR/styles" | |
mkdir -p "$ABSOLUTE_PORTABLE_DIR/imageformats" | |
cp iconengines/qsvgicon.dll "$ABSOLUTE_PORTABLE_DIR/iconengines" | |
cp platforms/qwindows.dll "$ABSOLUTE_PORTABLE_DIR/platforms" | |
cp styles/q*windows*style.dll "$ABSOLUTE_PORTABLE_DIR/styles" | |
if [ "$QT_VERSION_MAJ" = 5 ]; then | |
mkdir -p "$ABSOLUTE_PORTABLE_DIR/printsupport" | |
cp printsupport/windowsprintersupport.dll "$ABSOLUTE_PORTABLE_DIR/printsupport" | |
fi | |
for f in qgif qicns qico qjpeg qsvg qtga qtiff qwbmp; do | |
cp imageformats/$f.dll "$ABSOLUTE_PORTABLE_DIR/imageformats" | |
done | |
if [ "$QT_VERSION_MAJ" = 6 ]; then | |
for f in qjp2 qmng qwebp; do | |
cp imageformats/$f.dll "$ABSOLUTE_PORTABLE_DIR/imageformats" | |
done | |
mkdir -p "$ABSOLUTE_PORTABLE_DIR/tls" | |
cp tls/qopensslbackend.dll "$ABSOLUTE_PORTABLE_DIR/tls" | |
fi | |
- name: Prepare portable distro (Deps) | |
shell: bash | |
run: | | |
cd ../lib | |
cp *.dll "$ABSOLUTE_PORTABLE_DIR" | |
cd "$ICU_LIBDIR" | |
cp libicuio$ICU_VER.dll libicuin$ICU_VER.dll libicuuc$ICU_VER.dll libicudt$ICU_VER.dll "$ABSOLUTE_PORTABLE_DIR" | |
if [ "$QT_FROM_PACKAGES" = 1 ]; then | |
cp libcrypto-3.dll libssl-3.dll tcl86.dll "$ABSOLUTE_PORTABLE_DIR" | |
fi | |
- name: Prepare portable distro (Resources) | |
shell: bash | |
run: | | |
cp SQLiteStudio3/guiSQLiteStudio/img/sqlitestudio.ico "$ABSOLUTE_PORTABLE_DIR"/appicon.ico | |
cp SQLiteStudio3/guiSQLiteStudio/img/sqlitestudio.svg "${{ env.PORTABLE_DIR }}"/appicon.svg | |
- name: Determine SQLiteStudio version | |
shell: bash | |
run: | | |
set -x | |
cd $ABSOLUTE_PORTABLE_DIR | |
./sqlitestudiocli.exe --version | |
SQLITESTUDIO_VERSION="$(./sqlitestudiocli.exe --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 }}" >> $GITHUB_ENV | |
- name: Assemble portable package | |
shell: bash | |
run: | | |
cd $ABSOLUTE_PORTABLE_DIR/.. | |
7z a -r sqlitestudio-$PACKAGE_VERSION.zip SQLiteStudio | |
- name: Install the InstalBuilder | |
shell: bash | |
env: | |
IB_LICENSE: ${{ secrets.INSTALLER_LICENSE }} | |
run: | | |
curl -L ${{ env.INSTALLBUILDER_URL }} --output ib.exe | |
./ib.exe --mode unattended --prefix ${{ env.INSTALLBUILDER_DIR }} | |
${{ env.INSTALLBUILDER_DIR }}/bin/builder-cli.exe --version | |
echo "$IB_LICENSE" > lic.xml | |
echo "INSTALLER_SRC_PREFIX=$(pwd)" >> $GITHUB_ENV | |
echo "INSTALLER_BIN_PREFIX=$ABSOLUTE_PORTABLE_DIR" >> $GITHUB_ENV | |
- name: Create installer package | |
shell: bash | |
run: | | |
${{ env.INSTALLBUILDER_DIR }}/bin/builder-cli.exe build SQLiteStudio-installer.xml \ | |
--license lic.xml \ | |
--setvars project.outputDirectory=$(pwd) \ | |
--setvars project.version=$SQLITESTUDIO_VERSION | |
ls -l | |
mv SQLiteStudio-${{ env.SQLITESTUDIO_VERSION }}-windows-installer.exe \ | |
SQLiteStudio-$PACKAGE_VERSION-windows-installer.exe \ | |
- name: SHA256 checksums | |
shell: bash | |
run: | | |
sha256sum output/portable/sqlitestudio-${{ env.SQLITESTUDIO_VERSION }}.zip | |
sha256sum SQLiteStudio-${{ env.SQLITESTUDIO_VERSION }}-windows-installer.exe | |
- name: Upload package artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sqlitestudio-${{ env.PACKAGE_VERSION }}.zip | |
path: output/portable/sqlitestudio-${{ env.PACKAGE_VERSION }}.zip | |
- name: Upload installer artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: SQLiteStudio-${{ env.PACKAGE_VERSION }}-windows-installer.exe | |
path: SQLiteStudio-${{ env.PACKAGE_VERSION }}-windows-installer.exe |