MacOSX release build #443
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' | |
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-osx-installer.dmg | |
name: MacOSX release build | |
on: | |
workflow_dispatch: | |
inputs: | |
use_ccache: | |
description: 'Use ccache (for workflow debugging only!)' | |
required: false | |
type: boolean | |
schedule: | |
- cron: '0 3 * * 1' # run at 3 AM UTC every Monday | |
repository_dispatch: | |
types: [mac_release] | |
jobs: | |
build: | |
runs-on: ${{ matrix.runner || 'macos-12' }} | |
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: Install the InstallBuilder | |
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: ${{ github.event.client_payload.branch }} | |
- 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: | | |
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 ${{ matrix.cflags }} -lpthread -ldl -lm -Os -fpic -shared -o libsqlite3.0.dylib \ | |
-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 | |
sudo mkdir -p /usr/local/lib /usr/local/include # not there on macOS 14 runner | |
sudo cp libsqlite3.0.dylib /usr/local/lib/ | |
sudo ln -f -s /usr/local/lib/libsqlite3.0.dylib /usr/local/lib/libsqlite3.dylib | |
sudo cp *.h /usr/local/include/ | |
echo "DYLD_LIBRARY_PATH=/usr/local/lib" >> $GITHUB_ENV | |
- name: Compile additional SQLite3 extensions | |
shell: bash | |
run: | | |
cd .. | |
mkdir ext | |
curl -L http://sqlite.org/$SQLITE_RELEASE_YEAR/sqlite-src-$SQLITE_VERSION.zip --output sqlite-src-$SQLITE_VERSION.zip | |
ls -l | |
unzip sqlite-src-$SQLITE_VERSION.zip -x '*.test' | |
ls -l | |
cd sqlite-src-$SQLITE_VERSION/ext | |
ls -l | |
FLAGS="${{ matrix.cflags }} -ldl -Os -fpic -shared -I/usr/local/include -L/usr/local/lib -lsqlite3" | |
for f in compress sqlar; do | |
echo "gcc misc/$f.c -Imisc $FLAGS -lz -o ../../ext/$f.dylib" | |
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 | |
echo "gcc misc/$f.c -Imisc $FLAGS -o ../../ext/$f.dylib" | |
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" | |
echo "gcc icu/$f.c -Iicu $ICU_FLAGS $FLAGS -o ../../ext/$f.dylib" | |
gcc icu/$f.c -Iicu $ICU_FLAGS $FLAGS -o ../../ext/$f.dylib | |
done | |
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 | |
- 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: | | |
echo "SQLITESTUDIO_VERSION=$(SQLiteStudio.app/Contents/MacOS/sqlitestudiocli -v | awk '{print $2}')" >> $GITHUB_ENV | |
- name: Create installer package | |
shell: bash | |
env: | |
IB_LICENSE: ${{ secrets.INSTALLER_LICENSE }} | |
run: | | |
echo "$IB_LICENSE" > lic.xml | |
hdiutil attach output/SQLiteStudio/sqlitestudio-${{ env.SQLITESTUDIO_VERSION }}.dmg \ | |
-mountpoint /Volumes/SQLiteStudio | |
${{ env.INSTALLBUILDER_DIR }}/bin/builder build SQLiteStudio-installer.xml \ | |
--license lic.xml \ | |
--setvars project.outputDirectory=$(pwd) \ | |
--setvars project.version=${{ env.SQLITESTUDIO_VERSION }} | |
ls -l | |
- name: Rename package | |
run: | | |
mv output/SQLiteStudio/sqlitestudio-${{ env.SQLITESTUDIO_VERSION }}.dmg \ | |
sqlitestudio-${{ env.SQLITESTUDIO_VERSION }}${{ matrix.dmg_postfix }}.dmg | |
- name: Upload package artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sqlitestudio-${{ env.SQLITESTUDIO_VERSION }}${{ matrix.dmg_postfix }}.dmg | |
path: sqlitestudio-${{ env.SQLITESTUDIO_VERSION }}${{ matrix.dmg_postfix }}.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 }} |