-
-
Notifications
You must be signed in to change notification settings - Fork 595
236 lines (207 loc) · 9.75 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
env:
QT_VERSION: '5.15.2'
TCL_VERSION: '8.6'
SQLITE_VERSION: '3470100'
SQLITE_RELEASE_YEAR: '2024'
PYTHON_VERSION: '3.9'
ICU_VERSION: '72.1'
PORTABLE_DIR: ${{ github.workspace }}/output/portable/SQLiteStudio
INSTALLBUILDER_DIR: ../ib
INSTALLBUILDER_URL: https://releases.bitrock.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: macos-13
steps:
# - name: Debug
# run: |
# 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
- 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: 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
echo "After update:"
cat $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
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: 'x64'
- name: Clone repo
uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.branch }}
- name: Prepare ccache
if: inputs.use_ccache || false
uses: hendrikmuhs/[email protected]
with:
key: mac_release
max-size: "24M"
- 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 -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 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: Install extension dependencies
run: |
brew tap-new $USER/local-tap
brew extract --version=$ICU_VERSION icu4c $USER/local-tap
brew install icu4c@$ICU_VERSION
brew install coreutils
echo ICU_FLAGS="$(PKG_CONFIG_PATH="/usr/local/opt/icu4c@$ICU_VERSION/lib/pkgconfig" pkg-config --libs --cflags icu-uc icu-io)" \
>> $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
ls -l
cd sqlite-src-$SQLITE_VERSION/ext
ls -l
FLAGS="-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
# 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 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
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: Install Tcl
run: |
brew install tcl-tk
echo "PATH=/usr/local/opt/tcl-tk/bin:$PATH" >> $GITHUB_ENV
- 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 \
$([ ${{ inputs.use_ccache || false }} = false ] || echo "CONFIG+=ccache") \
CONFIG+=portable \
../../SQLiteStudio3
make -j 2
- name: Compile Plugins
working-directory: output/build/Plugins
run: |
qmake \
$([ ${{ inputs.use_ccache || false }} = false ] || echo "CONFIG+=ccache") \
CONFIG+=portable \
"INCLUDEPATH+=$pythonLocation/include/python$PYTHON_VERSION" "LIBS += -L$pythonLocation/lib" \
../../../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
${{ 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: SHA256 checksums
shell: bash
run: |
sha256sum output/SQLiteStudio/sqlitestudio-${{ env.SQLITESTUDIO_VERSION }}.dmg
sha256sum SQLiteStudio-${{ env.SQLITESTUDIO_VERSION }}-osx-installer.dmg
- name: Upload package artifact
uses: actions/upload-artifact@v4
with:
name: sqlitestudio-${{ env.SQLITESTUDIO_VERSION }}.dmg
path: output/SQLiteStudio/sqlitestudio-${{ env.SQLITESTUDIO_VERSION }}.dmg
- name: Upload installer artifact
uses: actions/upload-artifact@v4
with:
name: SQLiteStudio-${{ env.SQLITESTUDIO_VERSION }}-osx-installer.dmg
path: SQLiteStudio-${{ env.SQLITESTUDIO_VERSION }}-osx-installer.dmg