MacOSX release build #530
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' | |
TCL_VERSION: '8.6.16' | |
SQLITE_VERSION: '3470200' | |
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-osx-installer.dmg | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
name: MacOSX 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: '0 3 * * 1' # run at 3 AM UTC every Monday | |
repository_dispatch: | |
types: [mac_release] | |
jobs: | |
build: | |
runs-on: ${{ matrix.runner || 'macos-13' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
binary_compatibility: | |
- "darwin_16.x86_64" # macOS 10.12, the earliest version supported by QT 5.13 | |
- "darwin_17.x86_64" # macOS 10.13, the earliest version supported by QT 5.15 | |
- "darwin_18.x86_64" # macOS 10.14, the earliest version supported by QT 6.4 | |
#- "darwin_20.x86_64" # macOS 11, the earliest version supported by QT 6.5 | |
#- "darwin_20.arm64" # macOS 11, the earliest ARM64 version; temporarily no upstream binary packages | |
- "darwin_21.arm64" # macOS 12, the earliest ARM64 version we have MacPorts binary packages for | |
qt_version: | |
- "5.13.2" | |
- "5.15.12" | |
- "6.4.3" | |
exclude: | |
- binary_compatibility: "darwin_16.x86_64" | |
qt_version: "5.15.12" | |
- binary_compatibility: "darwin_16.x86_64" | |
qt_version: "6.4.3" | |
- binary_compatibility: "darwin_17.x86_64" | |
qt_version: "5.13.2" | |
- binary_compatibility: "darwin_17.x86_64" | |
qt_version: "6.4.3" | |
- binary_compatibility: "darwin_18.x86_64" | |
qt_version: "5.13.2" | |
- binary_compatibility: "darwin_18.x86_64" | |
qt_version: "5.15.12" | |
- binary_compatibility: "darwin_21.arm64" | |
qt_version: "5.13.2" | |
include: | |
# this list is meant to be synchronized with mac_deps.yml | |
- common_pkgs: | |
- brotli 1.1.0_0 | |
- dbus 1.14.10_1 | |
- double-conversion 3.3.0_0 | |
- freetype 2.13.2_0 | |
- gettext-runtime 0.22.5_0 | |
- giflib 4.2.3_1 | |
- glib2 2.78.4_1+x11 | |
- graphite2 1.3.14_0 | |
- harfbuzz 8.5.0_0 | |
- icu 74.2_0 | |
- jasper 4.2.4_0 | |
- lcms2 2.16_0 | |
- lerc 4.0.0_1 | |
- lz4 1.10.0_0 | |
- libdeflate 1.20_0 | |
- libedit 20240517-3.1_0 | |
- libffi 3.4.6_1 | |
- libiconv 1.17_0 | |
- libjpeg-turbo 3.0.3_0 | |
- libmng 2.0.3_1 | |
- libpng 1.6.43_0 | |
- ncurses 6.5_0 | |
- openssl3 3.3.1_1 | |
- pcre 8.45_0 | |
- pcre2 10.44_0 | |
- python39 3.9.19_0+lto+optimizations | |
- tcl 8.6.14_0+corefoundation+threads | |
- tiff 4.6.0_0 | |
- webp 1.4.0_0 | |
- xz 5.4.7_0 | |
- zlib 1.3.1_0 | |
- zstd 1.5.6_0 | |
host_pkgs: | |
- ccache 4.10.2_0+doc | |
- hiredis 1.2.0_0 | |
- binary_compatibility: darwin_21.arm64 | |
qt_version: "5.15.12" | |
cflags: -arch arm64 -mmacosx-version-min=11 | |
dmg_postfix: "-macos11.arm64" | |
pkgs: | |
- qt5-qtbase 5.15.12_1+openssl | |
- qt5-qtdeclarative 5.15.12_0 | |
- qt5-qtimageformats 5.15.12_0 | |
- qt5-qtscript 5.15.12_0 | |
- qt5-qtsvg 5.15.12_0 | |
- qt5-qttools 5.15.12_0 | |
runner: macos-14 | |
runner_binary_compatibility: darwin_23.arm64 | |
- binary_compatibility: darwin_21.arm64 | |
qt_version: "6.4.3" | |
cflags: -arch arm64 -mmacosx-version-min=11 | |
dmg_postfix: "-macos11.arm64-qt6" | |
pkgs: | |
- libb2 0.98.1_1 | |
- md4c 0.4.8_0 | |
- qt6-qtbase 6.4.3_6+openssl | |
- qt6-qtdeclarative 6.4.3_0 | |
- qt6-qtimageformats 6.4.3_0 | |
- qt6-qtsvg 6.4.3_1 | |
- qt6-qttools 6.4.3_1 | |
- qt6-qt5compat 6.4.3_2 | |
runner: macos-14 | |
runner_binary_compatibility: darwin_23.arm64 | |
- binary_compatibility: darwin_18.x86_64 | |
qt_version: "6.4.3" | |
cflags: -mmacosx-version-min=10.14 | |
dmg_postfix: "-macos10.14-qt6" | |
pkgs: | |
- libb2 0.98.1_1 | |
- md4c 0.4.8_0 | |
- qt6-qtbase 6.4.3_6+openssl | |
- qt6-qtdeclarative 6.4.3_0 | |
- qt6-qtimageformats 6.4.3_0 | |
- qt6-qtsvg 6.4.3_1 | |
- qt6-qttools 6.4.3_1 | |
- qt6-qt5compat 6.4.3_2 | |
runner_binary_compatibility: darwin_21.x86_64 | |
- binary_compatibility: darwin_17.x86_64 | |
qt_version: "5.15.12" | |
cflags: -arch x86_64 -mmacosx-version-min=10.13 | |
add_variants: "" | |
dmg_postfix: "-macos10.13" | |
pkgs: | |
- qt5-qtbase 5.15.12_1+openssl | |
- qt5-qtdeclarative 5.15.12_0 | |
- qt5-qtimageformats 5.15.12_0 | |
- qt5-qtscript 5.15.12_0 | |
- qt5-qtsvg 5.15.12_0 | |
- qt5-qttools 5.15.12_0 | |
qmake_flags: "" | |
runner_binary_compatibility: darwin_21.x86_64 | |
- binary_compatibility: darwin_16.x86_64 | |
qt_version: "5.13.2" | |
cflags: -arch x86_64 -mmacosx-version-min=10.12 | |
add_variants: "" | |
dmg_postfix: "-macos10.12" | |
pkgs: | |
- legacy-support 1.2.4_0 | |
- qt513-qtbase 5.13.2_10+openssl | |
- qt513-qtdeclarative 5.13.2_0 | |
- qt513-qtimageformats 5.13.2_3 | |
- qt513-qtscript 5.13.2_0 | |
- qt513-qtsvg 5.13.2_0 | |
- qt513-qttools 5.13.2_0 | |
qmake_flags: "" | |
runner_binary_compatibility: darwin_21.x86_64 | |
steps: | |
- name: Uninstall unwanted Homebrew packages and their dependents | |
run: | | |
if brew list tcl-tk 2>/dev/null; then | |
brew uninstall tcl-tk r | |
fi | |
#- name: Debug | |
#shell: bash | |
#run: | | |
# brew search tcl-tk | |
# ls -l /usr/local/ | |
# ls -l /usr/local/include | |
# ls -l /usr/local/opt/ | |
# ls -l /usr/local/opt/openssl/include/ | |
# ls -l /usr/local/opt/expat/include | |
# 4 commented steps below are merged from 3.4 branch workflows and will probably be used in 3.5, but not yet | |
#- name: Install Tcl | |
# run: | | |
# set -x | |
# #brew install tcl-tk@8 | |
# #brew reinstall tcl-tk@8 | |
# echo "PATH=/usr/local/Cellar/tcl-tk@8/${{ env.TCL_VERSION }}/bin:$PATH" >> $GITHUB_ENV | |
# echo "TCL_CONFIG=/usr/local/Cellar/tcl-tk@8/${{ env.TCL_VERSION }}/lib/tclConfig.sh" >> $GITHUB_ENV | |
# | |
# find /usr/local -name tclsh | |
# find /usr/local -name tclConfig.sh | |
#- 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@v3 | |
# with: | |
# cache: true | |
# version: ${{ env.QT_VERSION }} | |
# host: 'mac' | |
# dir: '${{ steps.qt-installation-dir.DIR }}' | |
# aqtversion: '==3.0.*' | |
# py7zrversion: '==0.20.*' | |
# setup-python: 'false' | |
# extra: '--external 7z' | |
- 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: Fix Qt for MacOS 13 | |
# shell: bash | |
# run: | | |
# TCFILE=$(find $Qt5_DIR/mkspecs/features -name toolchain.prf -type f -maxdepth 1) | |
# echo "Updating file: $TCFILE" | |
# sed -i '' 's/if(!darwin:clang)|intel_icc/if(!darwin:clang)|intel_icc|darwin/' $TCFILE | |
- name: Install the InstalBuilder | |
shell: bash | |
run: | | |
curl -L ${{ env.INSTALLBUILDER_URL }} --output ib.dmg | |
hdiutil attach ib.dmg | |
/Volumes/InstallBuilder\ Enterprise/*.app/Contents/MacOS/installbuilder.sh --mode unattended --prefix ${{ env.INSTALLBUILDER_DIR }} | |
${{ env.INSTALLBUILDER_DIR }}/bin/builder --version | |
echo "INSTALLER_SRC_PREFIX=$(pwd)" >> $GITHUB_ENV | |
echo "INSTALLER_BIN_PREFIX=/Volumes/SQLiteStudio" >> $GITHUB_ENV | |
- name: Clone repo | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.BRANCH_NAME }} | |
- name: Restore distfiles packages cache | |
id: cache-distfiles | |
uses: actions/cache/restore@v4 | |
with: | |
path: distfiles | |
key: distfiles-${{ matrix.binary_compatibility }}--${{ github.sha }} | |
restore-keys: distfiles-${{ matrix.binary_compatibility }}-- | |
- name: Install MacPorts packages | |
run: | | |
mkdir macports | |
install_binpkg() { | |
_compat="$1"; shift | |
while [ -n "$1" ]; do | |
local _postfix="$(echo "$2${{ matrix.add_variants}}" | sed 's/+x11+universal/+universal+x11/')" | |
_pkg="distfiles/$1-$_postfix.$_compat.tbz2" | |
echo "Installing $_pkg" | |
tar -C macports -xjf "$_pkg" | |
shift 2 | |
done | |
} | |
install_binpkg ${{ matrix.runner_binary_compatibility }} ${{ join(matrix.host_pkgs, ' ') }} | |
install_binpkg ${{ matrix.binary_compatibility }} ${{ join(matrix.common_pkgs, ' ') }} ${{ join(matrix.pkgs, ' ') }} | |
- name: Configure MacPorts packages | |
run: | | |
sudo ln -s $(pwd)/macports/opt/local /opt/ | |
case "${{ join(matrix.pkgs, ' ') }}" in | |
*qt6*) echo "PATH=/opt/local/libexec/qt6/bin:/opt/local/bin:$PATH" >> $GITHUB_ENV ;; | |
*) echo "PATH=/opt/local/libexec/qt5/bin:/opt/local/bin:$PATH" >> $GITHUB_ENV ;; | |
esac | |
echo "pythonLocation=/opt/local/Library/Frameworks/Python.framework/Versions/$PYTHON_VERSION" >> $GITHUB_ENV | |
if [ ${{ matrix.binary_compatibility }} = "darwin_16.x86_64" ]; then | |
# QtImageFormats 5.13 binary is linked to an older version of libtiff | |
sudo install_name_tool -change /opt/local/lib/libtiff.5.dylib /opt/local/lib/libtiff.6.dylib \ | |
/opt/local/libexec/qt5/plugins/imageformats/libqtiff.dylib | |
fi | |
- name: Prepare ccache | |
if: inputs.use_ccache || false | |
uses: hendrikmuhs/ccache-action@v1.2 | |
with: | |
key: ${{ matrix.binary_compatibility }} | |
max-size: "32M" | |
- 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: | | |
SQLITE_DOT_VERSION=$($GH_SCRIPTS/convert_int_ver.sh $SQLITE_VERSION) | |
echo "SQLITE_DOT_VERSION=$SQLITE_DOT_VERSION" >> $GITHUB_ENV | |
cd .. | |
SQLITE3_ZIP=sqlite3-macos-x64-$SQLITE_VERSION.zip | |
curl -L https://github.com/pawelsalawa/sqlite3-sqls/releases/download/v$SQLITE_DOT_VERSION/$SQLITE3_ZIP --output $SQLITE3_ZIP | |
sudo unzip $SQLITE3_ZIP libsqlite3.0.dylib -d /usr/local/lib | |
sudo unzip $SQLITE3_ZIP sqlite3.h sqlite3ext.h -d /usr/local/include | |
sudo ln -f -s /usr/local/lib/libsqlite3.0.dylib /usr/local/lib/libsqlite3.dylib | |
echo "DYLD_LIBRARY_PATH=/usr/local/lib" >> $GITHUB_ENV | |
ls -l /usr/local/lib/libsqlite3* | |
ls -l /usr/local/include/sqlite* | |
- name: Compile additional SQLite3 extensions | |
shell: bash | |
run: | | |
cd .. | |
mkdir ext | |
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 | |
ls -l | |
mkdir ext-src | |
unzip sqlite3-extensions-src-$SQLITE_VERSION.zip -d ext-src | |
cd ext-src | |
ls -l | |
FLAGS="-ldl -Os -fpic -shared -I/usr/local/include -L/usr/local/lib -lsqlite3" | |
set -x | |
for f in compress sqlar; do | |
gcc misc/$f.c -Imisc $FLAGS -lz -o ../ext/$f.dylib | |
done | |
for f in csv decimal eval ieee754 percentile rot13 series uint uuid zorder; do | |
gcc misc/$f.c -Imisc $FLAGS -o ../ext/$f.dylib | |
done | |
for f in icu; do | |
ICU_FLAGS="-I/opt/local/include -L/opt/local/lib -licuio -licui18n -licuuc -licudata" | |
gcc icu/$f.c -Iicu $ICU_FLAGS $FLAGS -o ../ext/$f.dylib | |
done | |
set +x | |
ls -l ../ext/ | |
- name: Prepare deps | |
run: | | |
mkdir ../lib ../include | |
cp /usr/local/lib/libsqlite3* ../lib | |
cp /usr/local/include/sqlite3* ../include | |
- name: Prepare output dir | |
run: mkdir output output/build output/build/Plugins | |
- name: Compile SQLiteStudio3 | |
working-directory: output/build | |
run: | | |
qmake ${{ matrix.qmake_flags }} \ | |
$([ ${{ inputs.use_ccache || false }} = false ] || echo "CONFIG+=ccache") \ | |
QMAKE_CXXFLAGS+="${{ matrix.cflags }}" \ | |
CONFIG+=portable \ | |
../../SQLiteStudio3 | |
make -j 2 | |
- name: Compile Plugins | |
working-directory: output/build/Plugins | |
run: | | |
qmake ${{ matrix.qmake_flags }} \ | |
$([ ${{ inputs.use_ccache || false }} = false ] || echo "CONFIG+=ccache") \ | |
QMAKE_CXXFLAGS+="${{ matrix.cflags }}" \ | |
CONFIG+=portable \ | |
"INCLUDEPATH+=$pythonLocation/include/python$PYTHON_VERSION" \ | |
../../../Plugins | |
make -j 1 | |
# This is how it was for 3.4 branch - probably will be ised in 3.5 | |
# "INCLUDEPATH+=$pythonLocation/include/python$PYTHON_VERSION" "LIBS += -L$pythonLocation/lib" \ | |
# "TCL_CONFIG=${{ env.TCL_CONFIG }}" \ | |
- name: Copy SQLite extensions to output dir | |
shell: bash | |
run: | | |
cp -R ../ext output/SQLiteStudio/SQLiteStudio.app/Contents/extensions | |
- name: Build packages | |
working-directory: output/build | |
run: | | |
make pkg | |
- name: Determine SQLiteStudio version | |
working-directory: output/SQLiteStudio | |
run: | | |
SQLITESTUDIO_VERSION=$(SQLiteStudio.app/Contents/MacOS/sqlitestudiocli -v | awk '{print $2}') | |
echo "SQLITESTUDIO_VERSION=$SQLITESTUDIO_VERSION" >> $GITHUB_ENV | |
echo "PACKAGE_VERSION=${SQLITESTUDIO_VERSION}-macos-x64" >> $GITHUB_ENV | |
- name: Rename portable package | |
working-directory: output/SQLiteStudio | |
run: | | |
mv sqlitestudio-${{ env.SQLITESTUDIO_VERSION }}.dmg sqlitestudio-${{ env.PACKAGE_VERSION }}.dmg | |
- name: Create installer package | |
shell: bash | |
env: | |
IB_LICENSE: ${{ secrets.INSTALLER_LICENSE }} | |
run: | | |
echo "$IB_LICENSE" > lic.xml | |
hdiutil attach output/SQLiteStudio/sqlitestudio-${{ env.PACKAGE_VERSION }}.dmg | |
${{ env.INSTALLBUILDER_DIR }}/bin/builder build SQLiteStudio-installer.xml \ | |
--license lic.xml \ | |
--setvars project.outputDirectory=$(pwd) \ | |
--setvars project.version=${{ env.SQLITESTUDIO_VERSION }} | |
mv SQLiteStudio-${{ env.SQLITESTUDIO_VERSION }}-osx-installer.dmg SQLiteStudio-${{ env.SQLITESTUDIO_VERSION }}-macos-x64-installer.dmg | |
ls -l | |
# 4 steps below need closer review and fix for 3.5.0 | |
# - name: Rename package | |
# run: | | |
# mv output/SQLiteStudio/sqlitestudio-${{ env.SQLITESTUDIO_VERSION }}.dmg \ | |
# sqlitestudio-${{ env.SQLITESTUDIO_VERSION }}${{ matrix.dmg_postfix }}.dmg | |
# - name: SHA256 checksums | |
# shell: bash | |
# run: | | |
# sha256sum output/SQLiteStudio/sqlitestudio-${{ env.PACKAGE_VERSION }}.dmg | |
# sha256sum SQLiteStudio-${{ env.SQLITESTUDIO_VERSION }}-macos-x64-installer.dmg | |
# - name: Upload package artifact | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: sqlitestudio-${{ env.PACKAGE_VERSION }}.dmg | |
# path: output/SQLiteStudio/sqlitestudio-${{ env.PACKAGE_VERSION }}.dmg | |
# - name: Upload installer artifact | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: SQLiteStudio-${{ env.SQLITESTUDIO_VERSION }}-osx-installer${{ matrix.dmg_postfix }}.dmg | |
# path: SQLiteStudio-${{ env.SQLITESTUDIO_VERSION }}-osx-installer.dmg | |
build-universal: | |
runs-on: macos-12 # Don't use newer versions yet, https://github.com/actions/runner-images/issues/7522 | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.client_payload.branch }} | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: sqlitestudio-[0-9].[0-9].[0-9]-macos10.13.dmg | |
merge-multiple: true | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: sqlitestudio-[0-9].[0-9].[0-9]-macos11.arm64.dmg | |
merge-multiple: true | |
- run: | | |
set -x | |
_prefix="$(echo sqlitestudio-[0-9].[0-9].[0-9]-macos11.arm64.dmg | sed 's/11.arm64.dmg$//')" | |
SQLiteStudio3/create_macosx_bundle.sh -u "${_prefix}10.13.dmg" "${_prefix}11.arm64.dmg" "${_prefix}-universal.dmg" | |
echo "PACKAGE_NAME=${_prefix}-universal.dmg" >> $GITHUB_ENV | |
- name: Upload package artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.PACKAGE_NAME }} | |
path: ${{ env.PACKAGE_NAME }} |