-
-
Notifications
You must be signed in to change notification settings - Fork 218
584 lines (486 loc) · 18.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
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
name: CI
on: [push, pull_request]
jobs:
build-linux-ubuntu-x64-clang:
if: github.ref_type != 'tag'
runs-on: ubuntu-22.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 cmake
- name: Build
run: |
CC=clang CXX=clang++ ./autogen.sh --enable-binreloc --prefix=/opt/firebird
make -j4
make tests -j4
make run_tests
make dist
tar xzvf gen/Firebird-*-linux-x64.tar.gz
(cd Firebird-*-linux-x64; sudo ./install.sh -silent)
- name: Upload installer
uses: actions/upload-artifact@v4
with:
name: firebird-ubuntu-20.04-clang-x64
path: gen/Firebird-*-linux-x64.tar.gz
build-linux-docker:
name: build-linux-docker-${{ matrix.arch }}
runs-on: ubuntu-22.04
env:
FB_DOCKER_PATH: ${{ (startsWith(matrix.arch, 'arm') && 'arm32-arm64') || 'x86-x64' }}
strategy:
fail-fast: false
matrix:
arch:
- x86
- x64
- arm32
- arm64
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10
- name: Adjust snapshot build number
uses: ./.github/actions/adjust-snapshot-buildno
- name: Get Release Notes
uses: ./.github/actions/get-release-notes
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
if: ${{ startsWith(matrix.arch, 'arm') }}
- name: Build
run: |
cd builds/docker/linux/$FB_DOCKER_PATH
./run-${{ matrix.arch }}.sh
- name: Upload installer
uses: actions/upload-artifact@v4
with:
name: firebird-linux-${{ matrix.arch }}
path: gen/Firebird-*-linux-${{ matrix.arch }}.tar.gz
- name: Upload debug symbols
uses: actions/upload-artifact@v4
with:
name: firebird-linux-${{ matrix.arch }}-debugSymbols
path: gen/Firebird-*-linux-${{ matrix.arch }}-debugSymbols.tar.gz
- name: Create release
uses: ./.github/actions/create-release
with:
token: ${{ secrets.SNAPSHOT_RELEASE_TOKEN }}
deletePatterns: Firebird-*-linux-${{ matrix.arch }}*.tar.gz
uploadFiles: gen/Firebird-*-linux-${{ matrix.arch }}*.tar.gz
build-src-bundle-docker:
name: build-src-bundle-docker
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10
- name: Adjust snapshot build number
uses: ./.github/actions/adjust-snapshot-buildno
- name: Get Release Notes
uses: ./.github/actions/get-release-notes
- name: Build
run: |
cd builds/docker/linux/x86-x64
./run-src-bundle.sh
- name: Create release
uses: ./.github/actions/create-release
with:
token: ${{ secrets.SNAPSHOT_RELEASE_TOKEN }}
deletePatterns: Firebird-*-source.tar.xz
uploadFiles: gen/Firebird-*-source.tar.xz
build-alpine-x64:
if: github.ref_type != 'tag'
runs-on: ubuntu-22.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 cmake 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 tests -j4
make run_tests
make dist
tar xzvf gen/Firebird-*-linux-x64.tar.gz
- name: Upload installer
uses: actions/upload-artifact@v4
with:
name: firebird-alpine-x64
path: gen/Firebird-*-linux-x64.tar.gz
build-windows:
if: github.ref_type != 'tag'
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"
choco uninstall --no-progress --yes innosetup
choco install --no-progress --yes innosetup --version=6.1.2
- 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: |
set SEVENZIP=C:\Program Files\7-Zip
set INNO6_SETUP_PATH=C:\Program Files (x86)\Inno Setup 6
if "%PLATFORM%" == "x64" set FB_VS_ARCH=amd64
if "%PLATFORM%" == "x64" set FB_PROCESSOR_ARCHITECTURE=AMD64
if "%PLATFORM%" == "x86" set FB_VS_ARCH=x86
if "%PLATFORM%" == "x86" set FB_PROCESSOR_ARCHITECTURE=x86
call "%VS_SCRIPT%" -arch=%FB_VS_ARCH%
cd builds\win32
call run_all.bat
call run_tests.bat
- name: Upload zip
uses: actions/upload-artifact@v4
with:
name: firebird-windows-vs-${{ env.VS_VERSION }}-${{ matrix.platform }}-zip
path: builds/install_images/Firebird-*-windows-${{ matrix.platform }}.zip
- name: Upload installer
uses: actions/upload-artifact@v4
with:
name: firebird-windows-vs-${{ env.VS_VERSION }}-${{ matrix.platform }}-installer
path: builds/install_images/*-windows-${{ matrix.platform }}.exe
build-windows-docker:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
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: Get Release Notes
uses: ./.github/actions/get-release-notes
- name: Build x86 for client package in x64
id: build-x86
shell: cmd
if: ${{ matrix.platform == 'x64' }}
run: |
mkdir builds\install_images
cd builds\docker\windows
call build.bat
call run.bat C:\fbscripts\build-x86.bat
- name: Build
id: build
shell: cmd
env:
PLATFORM: ${{ matrix.platform }}
run: |
mkdir builds\install_images
cd builds\docker\windows
call build.bat
call run.bat C:\fbscripts\build-%PLATFORM%.bat
- name: Upload zip
uses: actions/upload-artifact@v4
with:
name: firebird-windows-${{ matrix.platform }}-zip
path: builds/install_images/Firebird-*-windows-${{ matrix.platform }}.zip
- name: Upload zip (withDebugSymbols)
uses: actions/upload-artifact@v4
with:
name: firebird-windows-${{ matrix.platform }}-withDebugSymbols-zip
path: builds/install_images/Firebird-*-windows-${{ matrix.platform }}-withDebugSymbols.zip
- name: Upload installer
uses: actions/upload-artifact@v4
with:
name: firebird-windows-${{ matrix.platform }}-installer
path: builds/install_images/*-windows-${{ matrix.platform }}.exe
- name: Upload installer (withDebugSymbols)
uses: actions/upload-artifact@v4
with:
name: firebird-windows-${{ matrix.platform }}-withDebugSymbols-installer
path: builds/install_images/*-windows-${{ matrix.platform }}-withDebugSymbols.exe
- name: Create release
uses: ./.github/actions/create-release
with:
token: ${{ secrets.SNAPSHOT_RELEASE_TOKEN }}
deletePatterns: |
Firebird-*-windows-${{ matrix.platform }}*.exe
Firebird-*-windows-${{ matrix.platform }}*.zip
uploadFiles: |
builds/install_images/Firebird-*-windows-${{ matrix.platform }}*.exe
builds/install_images/Firebird-*-windows-${{ matrix.platform }}*.zip
build-macos:
name: build-macos-${{ matrix.arch }}
runs-on: ${{ (matrix.arch == 'arm64' && 'macos-14') || 'macos-13' }}
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
strategy:
fail-fast: false
matrix:
arch:
- x64
- arm64
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10
submodules: 'true'
- name: Adjust snapshot build number
uses: ./.github/actions/adjust-snapshot-buildno
- name: Prepare - Install tools
run: |
brew install automake autoconf-archive cmake libtool ninja
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Build
run: |
export LIBTOOLIZE=glibtoolize
export LIBTOOL=glibtool
./autogen.sh --with-builtin-tommath --with-builtin-tomcrypt
make -j4
make tests -j4
make run_tests
make -C gen -B -f make.platform.postfix
make -C gen -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@v4
with:
name: firebird-macos-${{ matrix.arch }}
path: gen/artifacts
- name: Create release
uses: ./.github/actions/create-release
with:
token: ${{ secrets.SNAPSHOT_RELEASE_TOKEN }}
deletePatterns: Firebird-*-macos-${{ matrix.arch }}*.pkg
uploadFiles: gen/artifacts/Firebird-*-macos-${{ matrix.arch }}*.pkg
build-android-initial:
name: build-android-${{ matrix.arch }}-initial
runs-on: ubuntu-22.04
env:
NDK: /home/runner/Android/Ndk
ARCH: ${{ matrix.arch }}
FB_PREFIX: ${{ (matrix.arch == 'arm32' && 'arme') || (matrix.arch == 'x64' && 'x86_64') || matrix.arch }}
strategy:
fail-fast: false
matrix:
arch:
- arm32
- arm64
- x86
- x64
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 Linux tools
run: |
sudo apt-get install libtool-bin libtomcrypt1 libtomcrypt-dev libtommath1 libtommath-dev libicu-dev zlib1g-dev
- name: Prepare - Download and install Android NDK
run: |
mkdir downloads
pushd downloads
curl -OL https://dl.google.com/android/repository/android-ndk-r25b-linux.zip
mkdir -p $NDK
unzip android-ndk-r25b-linux.zip -d $NDK && f=("$NDK"/*) && mv "$NDK"/*/* "$NDK" && rmdir "${f[@]}"
- name: Build
run: |
./autogen.sh --prefix=/opt/firebird --enable-binreloc --with-cross-build=android.$FB_PREFIX --without-editline
make -j4
make CROSS_OUT=Y tests -j4
builds/install/arch-specific/android/BuildPackage.sh $ARCH
- name: Upload initial build
uses: actions/upload-artifact@v4
with:
name: firebird-android-initial-${{ matrix.arch }}
path: |
gen/Firebird-*-android-initial-${{ matrix.arch }}*.tar.gz
gen/Make.Version
build-android-final:
name: build-android-${{ matrix.arch }}-final
needs: build-android-initial
runs-on: ubuntu-latest
env:
ARCH: ${{ matrix.arch }}
strategy:
fail-fast: false
matrix:
arch:
- arm32
- arm64
- x86
- x64
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10
- name: Adjust snapshot build number
uses: ./.github/actions/adjust-snapshot-buildno
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Download initial build
uses: actions/download-artifact@v4
with:
name: firebird-android-initial-${{ matrix.arch }}
path: gen
- name: Cache - AVD
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-v7
- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
avd-name: firebird-builder
arch: x86_64
api-level: 30
target: google_apis
ndk: 25.1.8937393
emulator-options: -no-window -noaudio -no-boot-anim -camera-back none -port 5554
emulator-boot-timeout: 900
script: |
echo "Generated AVD snapshot for caching."
- name: Create necessary files in Android emulator
uses: reactivecircus/android-emulator-runner@v2
with:
avd-name: firebird-builder
arch: x86_64
api-level: 30
target: google_apis
ndk: 25.1.8937393
emulator-options: -no-snapshot-save -no-window -noaudio -no-boot-anim -camera-back none -port 5554
emulator-boot-timeout: 900
script: |
adb wait-for-device
adb root
NDK=/usr/local/lib/android/sdk/ndk/25.1.8937393 builds/install/arch-specific/android/BuildFinalPackage.sh $ARCH
- name: Upload installer
uses: actions/upload-artifact@v4
with:
name: firebird-android-${{ matrix.arch }}
path: gen/Firebird-*-android-${{ matrix.arch }}.tar.gz
- name: Upload installer (withDebugSymbols)
uses: actions/upload-artifact@v4
with:
name: firebird-android-${{ matrix.arch }}-withDebugSymbols
path: gen/Firebird-*-android-${{ matrix.arch }}-withDebugSymbols.tar.gz
- name: Delete initial build
uses: geekyeggo/delete-artifact@v5
with:
name: firebird-android-initial-${{ matrix.arch }}
- name: Create release
uses: ./.github/actions/create-release
with:
token: ${{ secrets.SNAPSHOT_RELEASE_TOKEN }}
deletePatterns: Firebird-*-android-${{ matrix.arch }}*.tar.gz
uploadFiles: gen/Firebird-*-android-${{ matrix.arch }}*.tar.gz
build-android-aar:
needs: build-android-final
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10
- name: Adjust snapshot build number
uses: ./.github/actions/adjust-snapshot-buildno
- name: Download final build (x86)
uses: actions/download-artifact@v4
with:
name: firebird-android-x86
path: android/temp
- name: Download final build (x64)
uses: actions/download-artifact@v4
with:
name: firebird-android-x64
path: android/temp
- name: Download final build (arm32)
uses: actions/download-artifact@v4
with:
name: firebird-android-arm32
path: android/temp
- name: Download final build (arm64)
uses: actions/download-artifact@v4
with:
name: firebird-android-arm64
path: android/temp
- name: Extract final builds
working-directory: android
run: |
mkdir -p embedded/src/main/jniLibs/{x86,x86_64,armeabi-v7a,arm64-v8a}
tar xzvf temp/Firebird-*-android-x86.tar.gz -C embedded/src/main/jniLibs/x86 --strip-components=1
tar xzvf temp/Firebird-*-android-x64.tar.gz -C embedded/src/main/jniLibs/x86_64 --strip-components=1
tar xzvf temp/Firebird-*-android-arm32.tar.gz -C embedded/src/main/jniLibs/armeabi-v7a --strip-components=1
tar xzvf temp/Firebird-*-android-arm64.tar.gz -C embedded/src/main/jniLibs/arm64-v8a --strip-components=1
mkdir -p embedded/src/main/assets/firebird
mv embedded/src/main/jniLibs/x86/{*.conf,*.msg,*.dat,*.res} embedded/src/main/assets/firebird/
find embedded/src/main/jniLibs -type f ! -iname "*.so" -delete
- name: Assemble AAR
working-directory: android
run: |
./gradlew assembleRelease
FB_VERSION=`cd ../src/misc/ && . writeBuildNum.sh && echo $PRODUCT_VER_STRING-$FIREBIRD_PACKAGE_VERSION`
mv embedded/build/outputs/aar/firebird-embedded-release.aar \
embedded/build/outputs/aar/Firebird-$FB_VERSION-android-embedded.aar
- name: Upload installer
uses: actions/upload-artifact@v4
with:
name: firebird-android-aar
path: android/embedded/build/outputs/aar/Firebird-*-android-embedded.aar
- name: Create release
uses: ./.github/actions/create-release
with:
token: ${{ secrets.SNAPSHOT_RELEASE_TOKEN }}
deletePatterns: Firebird-*-android-embedded.aar
uploadFiles: android/embedded/build/outputs/aar/Firebird-*-android-embedded.aar