-
-
Notifications
You must be signed in to change notification settings - Fork 595
397 lines (366 loc) · 17.2 KB
/
mac_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
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/[email protected]
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 }}