forked from FirebirdSQL/firebird
-
Notifications
You must be signed in to change notification settings - Fork 0
396 lines (337 loc) · 14.7 KB
/
main.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
name: CI
on: [push, pull_request]
jobs:
build-linux-ubuntu-x64-clang:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10
- name: Adjust snapshot build number
uses: ./.github/actions/adjust-snapshot-buildno
- name: Prepare
run: |
sudo apt-get install libtool-bin libtomcrypt1 libtomcrypt-dev libtommath1 libtommath-dev libicu-dev zlib1g-dev
- name: Build
run: |
CC=clang CXX=clang++ ./autogen.sh --enable-binreloc --prefix=/opt/firebird
make -j4
make dist
tar xzvf gen/Firebird-[0-9]*.tar.gz
(cd Firebird-[0-9]*; sudo ./install.sh -silent)
- name: Upload installer
uses: actions/upload-artifact@main
with:
name: firebird-ubuntu-20.04-clang-x64
path: gen/Firebird-[0-9]*.tar.gz
build-linux-chroot:
name: build-linux-chroot-${{ matrix.arch }}
runs-on: ubuntu-22.04
env:
ARCH_SUFFIX: ${{ (matrix.arch == 'x64' && 'amd64' || (matrix.arch == 'x86' && 'i686' || '')) }}
ARCH_BITS: ${{ (matrix.arch == 'x64' && '64' || (matrix.arch == 'x86' && '32' || '')) }}
strategy:
fail-fast: false
matrix:
arch:
- x64
- x86
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10
- name: Adjust snapshot build number
uses: ./.github/actions/adjust-snapshot-buildno
- name: Download and extract chroot environment
run: |
wget --no-verbose -O - https://github.com/FirebirdSQL/snapshots/releases/download/tools/chroot-${ARCH_BITS}-gcc.6.4.tar.xz | sudo tar -xJ
- name: Build
run: |
sudo mkdir -p ${ARCH_BITS}-gcc.6.4/firebird
sudo ./start_chroot.sh <<"EOF"
cd /firebird
./autogen.sh --prefix=/opt/firebird --enable-binreloc --with-builtin-tomcrypt --with-termlib=:libncurses.a
make -j4
make dist
EOF
- name: Upload installer
uses: actions/upload-artifact@main
with:
name: firebird-linux-${{ matrix.arch }}
path: gen/Firebird-[0-9]*.${{ env.ARCH_SUFFIX }}.tar.gz
- name: Snapshot - prepare
id: snapshot_prepare
if: |
github.repository == 'FirebirdSQL/firebird' &&
github.event.head_commit.message == 'increment build number' &&
github.ref_name == 'v4.0-release'
run: |
echo "snapshot_name=v4.0" >> $GITHUB_OUTPUT
- name: Snapshot - delete old assets
uses: mknejp/delete-release-assets@v1
if: steps.snapshot_prepare.outputs.snapshot_name
with:
repository: FirebirdSQL/snapshots
token: ${{ secrets.SNAPSHOT_RELEASE_TOKEN }}
tag: snapshot-${{ steps.snapshot_prepare.outputs.snapshot_name }}
fail-if-no-release: false
fail-if-no-assets: false
assets: |
Firebird-*.${{ env.ARCH_SUFFIX }}.tar.gz
- name: Snapshot - release
id: snapshot_release_try1
uses: softprops/action-gh-release@v1
if: steps.snapshot_prepare.outputs.snapshot_name
continue-on-error: true
with:
repository: FirebirdSQL/snapshots
name: Latest snapshots for ${{ steps.snapshot_prepare.outputs.snapshot_name }}
tag_name: snapshot-${{ steps.snapshot_prepare.outputs.snapshot_name }}
prerelease: true
token: ${{ secrets.SNAPSHOT_RELEASE_TOKEN }}
files: |
gen/Firebird-*.${{ env.ARCH_SUFFIX }}.tar.gz
- name: Snapshot - release (retry)
uses: softprops/action-gh-release@v1
if: |
steps.snapshot_prepare.outputs.snapshot_name &&
steps.snapshot_release_try1.outcome == 'failure'
with:
repository: FirebirdSQL/snapshots
name: Latest snapshots for ${{ steps.snapshot_prepare.outputs.snapshot_name }}
tag_name: snapshot-${{ steps.snapshot_prepare.outputs.snapshot_name }}
prerelease: true
token: ${{ secrets.SNAPSHOT_RELEASE_TOKEN }}
files: |
gen/Firebird-*.${{ env.ARCH_SUFFIX }}.tar.gz
build-alpine-x64:
runs-on: ubuntu-20.04
container: alpine:3.14
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10
- name: Prepare
run: apk update && apk --no-cache --update add build-base libtool git autoconf automake zlib-dev icu-dev ncurses-dev libedit-dev linux-headers tar sed
- name: Adjust snapshot build number
uses: ./.github/actions/adjust-snapshot-buildno
- name: Build
run: |
./autogen.sh --enable-binreloc-threads --with-builtin-tommath --with-builtin-tomcrypt --prefix=/opt/firebird
make -j4
make dist
tar xzvf gen/Firebird-[0-9]*.tar.gz
- name: Upload installer
uses: actions/upload-artifact@main
with:
name: firebird-alpine-x64
path: gen/Firebird-[0-9]*.tar.gz
build-windows:
runs-on: ${{ matrix.os }}
env:
VS_VERSION: ${{ (matrix.os == 'windows-2019' && '2019' || (matrix.os == 'windows-2022' && '2022' || '')) }}
strategy:
fail-fast: false
matrix:
os:
- windows-2022
- windows-2019
platform: [x64, x86]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10
- name: Adjust snapshot build number
uses: ./.github/actions/adjust-snapshot-buildno
- name: Prepare
shell: cmd
run: |
for /r %%i in (*.bat) do unix2dos "%%i"
- name: Build
shell: cmd
env:
PLATFORM: ${{ matrix.platform }}
VS_SCRIPT: ${{ matrix.os == 'windows-2022' && 'C:\Program Files\Microsoft Visual Studio\%VS_VERSION%\Enterprise\Common7\Tools\VsDevCmd.bat' || 'C:\Program Files (x86)\Microsoft Visual Studio\%VS_VERSION%\Enterprise\Common7\Tools\VsDevCmd.bat' }}
run: |
if "%PLATFORM%" == "x64" set FB_VS_ARCH=amd64
if "%PLATFORM%" == "x64" set FB_PROCESSOR_ARCHITECTURE=AMD64
if "%PLATFORM%" == "x64" set FB_ARTIFACTS_DIR=output_x64
if "%PLATFORM%" == "x86" set FB_VS_ARCH=x86
if "%PLATFORM%" == "x86" set FB_PROCESSOR_ARCHITECTURE=x86
if "%PLATFORM%" == "x86" set FB_ARTIFACTS_DIR=output_win32
echo FB_ARTIFACTS_DIR=%FB_ARTIFACTS_DIR% >> %GITHUB_ENV%
call "%VS_SCRIPT%" -arch=%FB_VS_ARCH%
cd builds\win32
call run_all.bat JUSTBUILD
- name: Upload zip
uses: actions/upload-artifact@main
with:
name: firebird-windows-${{ matrix.platform }}-vs-${{ env.VS_VERSION }}
path: ${{ env.FB_ARTIFACTS_DIR }}
build-macos:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10
- name: Adjust snapshot build number
uses: ./.github/actions/adjust-snapshot-buildno
- name: Prepare - Install tools
run: |
brew install automake libtool ninja
# libcxx build is not working with python >= 3.12
- name: Do not use preinstalled python >= 3.12
run: |
brew uninstall --ignore-dependencies [email protected]
[ -e /Library/Frameworks/Python.framework ] && \
sudo mv /Library/Frameworks/Python.framework /Library/Frameworks/Python.framework.dont-look-at-this
brew install [email protected]
ln -s "$(brew --prefix [email protected])/bin/python3" "$(brew --prefix [email protected])/bin/python"
- name: Cache - libc++ install
id: cache-libcxx-install-macos
uses: actions/cache@v4
with:
key: ${{ runner.os }}-libcxx-install-13.0.1
path: |
extern/libcxx-macos-install
- name: Download libc++ sources
if: steps.cache-libcxx-install-macos.outputs.cache-hit != 'true'
run: |
mkdir extern/libcxx-macos
pushd extern/libcxx-macos
curl -OL https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.1/llvm-project-13.0.1.src.tar.xz
tar xJf llvm-project-13.0.1.src.tar.xz
popd
- name: Build libc++
if: steps.cache-libcxx-install-macos.outputs.cache-hit != 'true'
run: |
LIBCXX_BUILD_PATH=`pwd`/extern/libcxx-macos-build
LIBCXX_INSTALL_PATH=`pwd`/extern/libcxx-macos-install
mkdir $LIBCXX_BUILD_PATH
pushd extern/libcxx-macos/llvm-project-13.0.1.src
export MACOSX_DEPLOYMENT_TARGET=10.9
cmake -G Ninja -S llvm -B $LIBCXX_BUILD_PATH \
-DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi" \
-DCMAKE_INSTALL_PREFIX=$LIBCXX_INSTALL_PATH \
-DCMAKE_BUILD_TYPE=Release \
-DLIBCXX_ENABLE_SHARED=false \
-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=true
ninja -C $LIBCXX_BUILD_PATH cxx cxxabi
ninja -C $LIBCXX_BUILD_PATH install-cxx install-cxxabi
popd
- name: Cache - libicu install
id: cache-libicu-install-macos
uses: actions/cache@v4
with:
key: ${{ runner.os }}-libicu-install-63.2
path: |
extern/libicu-macos-install
- name: Download and patch libicu sources
if: steps.cache-libicu-install-macos.outputs.cache-hit != 'true'
run: |
mkdir extern/libicu-macos
pushd extern/libicu-macos
curl -OL https://github.com/unicode-org/icu/releases/download/release-63-2/icu4c-63_2-src.tgz
curl -OL https://github.com/unicode-org/icu/commit/24aeb9a5a5874f4ce5db912e30670ac3ae236971.patch
tar xzf icu4c-63_2-src.tgz
cd icu/source
patch -p3 < ../../24aeb9a5a5874f4ce5db912e30670ac3ae236971.patch
popd
- name: Build libicu
if: steps.cache-libicu-install-macos.outputs.cache-hit != 'true'
run: |
export LIBTOOLIZE=glibtoolize
export LIBTOOL=glibtool
export PATH="$(brew --prefix [email protected])/bin:$PATH"
LIBICU_INSTALL_PATH=`pwd`/extern/libicu-macos-install
pushd extern/libicu-macos/icu/source
./runConfigureICU MacOSX --prefix=$LIBICU_INSTALL_PATH
make -j4
make install
install_name_tool -id @rpath/lib/libicuuc.dylib $LIBICU_INSTALL_PATH/lib/libicuuc.dylib
install_name_tool -id @rpath/lib/libicui18n.dylib $LIBICU_INSTALL_PATH/lib/libicui18n.dylib
install_name_tool -id @rpath/lib/libicudata.dylib $LIBICU_INSTALL_PATH/lib/libicudata.dylib
install_name_tool -change libicudata.63.dylib @loader_path/libicudata.63.dylib $LIBICU_INSTALL_PATH/lib/libicuuc.63.dylib
install_name_tool -change libicudata.63.dylib @loader_path/libicudata.63.dylib $LIBICU_INSTALL_PATH/lib/libicui18n.63.dylib
install_name_tool -change libicuuc.63.dylib @loader_path/libicuuc.63.dylib $LIBICU_INSTALL_PATH/lib/libicui18n.63.dylib
popd
- name: Build
run: |
export LIBTOOLIZE=glibtoolize
export LIBTOOL=glibtool
export PATH="$(brew --prefix [email protected])/bin:$PATH"
LIBCXX_INSTALL_PATH=`pwd`/extern/libcxx-macos-install
LIBICU_INSTALL_PATH=`pwd`/extern/libicu-macos-install
mkdir -p gen/Release/firebird/lib
cp -R $LIBICU_INSTALL_PATH/lib/libicu{data,i18n,uc}.*dylib gen/Release/firebird/lib/
export C_INCLUDE_PATH="$LIBICU_INSTALL_PATH/include:`xcrun --show-sdk-path`/usr/include"
export CPLUS_INCLUDE_PATH="$LIBCXX_INSTALL_PATH/include/c++/v1:$LIBICU_INSTALL_PATH/include:`xcrun --show-sdk-path`/usr/include"
export LIBRARY_PATH="$LIBCXX_INSTALL_PATH/lib:$LIBICU_INSTALL_PATH/lib:$LIBRARY_PATH"
./autogen.sh --with-builtin-tommath --with-builtin-tomcrypt
make -j4
(cd gen; make -B -f make.platform.postfix ICU_LOC="$LIBICU_INSTALL_PATH/lib/")
(cd gen; make -B -f Makefile.install)
# Rename directory to make sure the build is relocatable.
mv gen gen2
sudo installer -pkg gen2/Release/*.pkg -verbose -target /
export FIREBIRD_LOCK=`pwd`/temp
echo "create database 't.fdb'; select '1' from rdb\$database; select _win1252 '2' from rdb\$database; select _utf8 '3' collate unicode from rdb\$database;" | /Library/Frameworks/Firebird.framework/Resources/bin/isql
echo "create database 'localhost:/tmp/t.fdb' user sysdba password 'masterkey'; select '11' from rdb\$database; select _win1252 '22' from rdb\$database; select _utf8 '33' collate unicode from rdb\$database;" | /Library/Frameworks/Firebird.framework/Resources/bin/isql
mv gen2 gen
mkdir gen/artifacts
mv gen/Release/*.pkg gen/artifacts
- name: Upload installer
uses: actions/upload-artifact@main
with:
name: firebird-macos
path: gen/artifacts
- name: Snapshot - prepare
id: snapshot_prepare
if: |
github.repository == 'FirebirdSQL/firebird' &&
github.event.head_commit.message == 'increment build number' &&
github.ref_name == 'v4.0-release'
run: |
echo "snapshot_name=v4.0" >> $GITHUB_OUTPUT
- name: Snapshot - delete old assets
uses: mknejp/delete-release-assets@v1
if: steps.snapshot_prepare.outputs.snapshot_name
with:
repository: FirebirdSQL/snapshots
token: ${{ secrets.SNAPSHOT_RELEASE_TOKEN }}
tag: snapshot-${{ steps.snapshot_prepare.outputs.snapshot_name }}
fail-if-no-release: false
fail-if-no-assets: false
assets: |
Firebird-[0-9]*-x86_64.pkg
- name: Snapshot - release
id: snapshot_release_try1
uses: softprops/action-gh-release@v1
if: steps.snapshot_prepare.outputs.snapshot_name
continue-on-error: true
with:
repository: FirebirdSQL/snapshots
name: Latest snapshots for ${{ steps.snapshot_prepare.outputs.snapshot_name }}
tag_name: snapshot-${{ steps.snapshot_prepare.outputs.snapshot_name }}
prerelease: true
token: ${{ secrets.SNAPSHOT_RELEASE_TOKEN }}
files: |
gen/artifacts/Firebird-[0-9]*-x86_64.pkg
- name: Snapshot - release (retry)
uses: softprops/action-gh-release@v1
if: |
steps.snapshot_prepare.outputs.snapshot_name &&
steps.snapshot_release_try1.outcome == 'failure'
with:
repository: FirebirdSQL/snapshots
name: Latest snapshots for ${{ steps.snapshot_prepare.outputs.snapshot_name }}
tag_name: snapshot-${{ steps.snapshot_prepare.outputs.snapshot_name }}
prerelease: true
token: ${{ secrets.SNAPSHOT_RELEASE_TOKEN }}
files: |
gen/artifacts/Firebird-[0-9]*-x86_64.pkg