-
-
Notifications
You must be signed in to change notification settings - Fork 271
349 lines (309 loc) · 13.3 KB
/
Copy pathstatic-build.yml
File metadata and controls
349 lines (309 loc) · 13.3 KB
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
name: Static Client Build
on:
workflow_dispatch:
env:
ISC_USER: sysdba
ISC_PASSWORD: masterkey
jobs:
build-linux-static-client:
name: build-linux-static-client-${{ matrix.arch }}
runs-on: ${{ (matrix.arch == 'arm64' && 'ubuntu-24.04-arm') || 'ubuntu-24.04' }}
strategy:
fail-fast: false
matrix:
arch: [x64, x86]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10
- name: Firebird install
env:
FB_ARCH: ${{ matrix.arch }}
run: |
set -e
if [ "$FB_ARCH" = "x86" ]; then
sudo dpkg --add-architecture i386 && sudo apt-get update
FB_LIBS="libicu74:i386 libtommath1:i386 libz1:i386"
else
FB_LIBS="libtommath1"
fi
sudo apt-get install -y $FB_LIBS
FB_PACKAGE="Firebird-5.0.4.1812-0-linux-${FB_ARCH}.tar.gz"
FB_DIR="Firebird-5.0.4.1812-0-linux-${FB_ARCH}"
wget -nv -O "$FB_PACKAGE" "https://github.com/FirebirdSQL/firebird/releases/download/v5.0.4/$FB_PACKAGE"
tar xzvf "$FB_PACKAGE"
(cd "$FB_DIR"; sudo ./install.sh -silent)
FB_PASSWORD=$(sudo awk -F= '$1 == "ISC_PASSWORD" {print $2}' /opt/firebird/SYSDBA.password)
sudo /opt/firebird/bin/gsec -user sysdba -password "$FB_PASSWORD" -modify sysdba -pw masterkey
sudo sed -i \
-e 's/^ISC_PASSWORD=.*/ISC_PASSWORD=masterkey/' \
-e 's/^ISC_PASSWD=.*/ISC_PASSWD=masterkey/' \
/opt/firebird/SYSDBA.password
sudo usermod -a -G firebird "$(whoami)"
sudo gpasswd -r firebird
sudo mkdir -p /tmp/firebird-static
sudo chmod 777 /tmp/firebird-static
- name: Write build script
run: |
mkdir -p gen
cat > /tmp/build-static-client.sh <<'EOF'
#!/bin/sh
set -e
gcc -v
ld -v
make -v
cd /home/ctng/firebird-build
/firebird/autogen.sh \
--host=$BUILD_ARCH \
--prefix=/opt/firebird \
--enable-binreloc \
--with-builtin-tomcrypt \
--with-termlib=:libncurses.a \
--with-atomiclib=:libatomic.a \
--enable-client-only
make client_static -j$(nproc)
# CXX lives in gen/make.defaults (substituted by configure). The
# top-level Makefile only forwards targets to gen/ and has no CXX=.
CXX=$(sed -n 's/^[[:space:]]*CXX[[:space:]]*=[[:space:]]*//p' gen/make.defaults | head -n 1)
if test -z "$CXX"; then
echo "error: could not determine CXX from gen/make.defaults" >&2
exit 1
fi
echo "Linking example with CXX=$CXX"
"$CXX" /firebird/examples/interfaces/01.create.cpp \
-I/firebird/src/include \
-I/home/ctng/firebird-build/gen/Release/firebird/include \
-L/home/ctng/firebird-build/gen/Release/firebird/lib \
-L/home/ctng/firebird-build/temp/Release \
-lfbclient -ltommath -ltomcrypt -lz -ldl -pthread \
-o /home/ctng/firebird-build/gen/01.create
EOF
chmod +x /tmp/build-static-client.sh
- name: Build
run: |
docker run --platform ${{ (matrix.arch == 'x64' && 'amd64') || 'i386' }} --rm \
-e CTNG_UID=$(id -u) -e CTNG_GID=$(id -g) \
-v ${{ github.workspace }}:/firebird:ro \
-v ${{ github.workspace }}/gen:/home/ctng/firebird-build/gen \
-v /tmp/build-static-client.sh:/build.sh:ro \
firebirdsql/firebird-builder-linux:fb6-${{ matrix.arch }}-ng-v2
- name: Run interface example
run: |
mkdir -p static-client
cp -a gen/01.create /opt/firebird/lib/libtom* static-client/
LD_LIBRARY_PATH="$PWD/static-client" \
ISC_PATH=localhost:/tmp/firebird-static static-client/01.create
- name: Upload static library
uses: actions/upload-artifact@v4
with:
name: firebird-linux-${{ matrix.arch }}-static-client
path: gen/Release/firebird/lib/libfbclient.a
build-linux-static-client-arm64:
name: build-linux-static-client-arm64
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10
- name: Firebird install
run: |
set -e
sudo apt-get install -y libtommath-dev libtomcrypt-dev
FB_PACKAGE=Firebird-5.0.4.1812-0-linux-arm64.tar.gz
FB_DIR=Firebird-5.0.4.1812-0-linux-arm64
wget -nv -O "$FB_PACKAGE" "https://github.com/FirebirdSQL/firebird/releases/download/v5.0.4/$FB_PACKAGE"
tar xzvf "$FB_PACKAGE"
(cd "$FB_DIR"; sudo ./install.sh -silent)
FB_PASSWORD=$(sudo awk -F= '$1 == "ISC_PASSWORD" {print $2}' /opt/firebird/SYSDBA.password)
sudo /opt/firebird/bin/gsec -user sysdba -password "$FB_PASSWORD" -modify sysdba -pw masterkey
sudo sed -i \
-e 's/^ISC_PASSWORD=.*/ISC_PASSWORD=masterkey/' \
-e 's/^ISC_PASSWD=.*/ISC_PASSWD=masterkey/' \
/opt/firebird/SYSDBA.password
sudo usermod -a -G firebird "$(whoami)"
sudo gpasswd -r firebird
sudo mkdir -p /tmp/firebird-static
sudo chmod 777 /tmp/firebird-static
- name: Prepare
run: |
sudo apt-get install -y libtool-bin automake autoconf-archive libtool libicu-dev zlib1g-dev cmake
- name: Build
run: |
./autogen.sh \
--without-editline \
--enable-binreloc \
--prefix=/opt/firebird \
--enable-client-only
make client_static -j$(nproc)
- name: Compile and link interface example
run: |
g++ examples/interfaces/01.create.cpp \
-Isrc/include \
-Igen/Release/firebird/include \
-Lgen/Release/firebird/lib \
-Ltemp/Release \
-lfbclient -ltommath -ltomcrypt -lz -ldl -pthread \
-o /tmp/01.create
- name: Run interface example
run: |
ISC_PATH=localhost:/tmp/firebird-static /tmp/01.create
- name: Upload static library
uses: actions/upload-artifact@v4
with:
name: firebird-linux-arm64-static-client
path: gen/Release/firebird/lib/libfbclient.a
build-macos-static-client:
name: build-macos-static-client-${{ matrix.arch }}
runs-on: ${{ (matrix.arch == 'arm64' && 'macos-15') || 'macos-15-intel' }}
strategy:
fail-fast: false
matrix:
arch: [x64, arm64]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10
submodules: 'true'
- name: Prepare - Install tools
run: |
brew install --quiet automake autoconf-archive libtool ninja python-setuptools
- name: Firebird install
env:
FB_ARCH: ${{ matrix.arch }}
run: |
set -e
sudo chmod +a "everyone allow read,write,execute,delete,add_file,add_subdirectory,file_inherit,directory_inherit" /tmp
FB_PACKAGE="Firebird-5.0.4.1812-0-macos-${FB_ARCH}.pkg"
wget -nv -O "$FB_PACKAGE" "https://github.com/FirebirdSQL/firebird/releases/download/v5.0.4/$FB_PACKAGE"
sudo installer -verbose -pkg "$FB_PACKAGE" -target /
sudo mkdir -p /tmp/firebird-static
sudo chmod 777 /tmp/firebird-static
- name: Restore vcpkg cache
uses: actions/cache/restore@v4
id: restore-vcpkg-cache
with:
path: ~/.cache/vcpkg/archives
key: vcpkg-cache-${{ runner.os }}-${{ matrix.arch }}-staticclient-${{ hashFiles('vcpkg-custom/**', 'vcpkg.json', 'vcpkg-configuration.json') }}
restore-keys: |
vcpkg-cache-${{ runner.os }}-${{ matrix.arch }}-staticclient-
vcpkg-cache-${{ runner.os }}-${{ matrix.arch }}-
- name: Build
run: |
export LIBTOOLIZE=glibtoolize
export LIBTOOL=glibtool
./autogen.sh --with-builtin-tommath --with-builtin-tomcrypt --enable-client-only
make client_static -j4
- name: Compile and link interface example
run: |
clang++ examples/interfaces/01.create.cpp \
-Isrc/include \
-Igen/Release/firebird/include \
-Lgen/Release/firebird/lib \
-Ltemp/Release \
-lfbclient -ltommath -ltomcrypt -lz \
-liconv -lobjc -framework CoreFoundation -framework Foundation -framework Security \
-Wl,-rpath,"$GITHUB_WORKSPACE/gen/Release/firebird" \
-dead_strip \
-o /tmp/01.create
- name: Run interface example
run: |
ISC_PATH=localhost:/tmp/firebird-static /tmp/01.create
- name: Upload static library
uses: actions/upload-artifact@v4
with:
name: firebird-macos-${{ matrix.arch }}-static-client
path: gen/Release/firebird/lib/libfbclient.a
- name: Save vcpkg cache
uses: actions/cache/save@v4
if: steps.restore-vcpkg-cache.outputs.cache-hit != 'true'
with:
path: ~/.cache/vcpkg/archives
key: ${{ steps.restore-vcpkg-cache.outputs.cache-primary-key }}
build-windows-static-client:
name: build-windows-static-client-${{ matrix.platform }}
runs-on: ${{ (matrix.platform == 'arm64' && 'windows-11-arm') || 'windows-2025' }}
env:
VS_VERSION: ${{ (matrix.platform == 'arm64' && '2022') || '2026' }}
strategy:
fail-fast: false
matrix:
platform: [x64, x86, arm64]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10
- name: Prepare
shell: cmd
run: |
for /r %%i in (*.bat) do unix2dos "%%i"
- name: Prepare envs
shell: cmd
env:
PLATFORM: ${{ matrix.platform }}
run: |
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
if "%PLATFORM%" == "x86" set FB_LIBRARY_PLATFORM=Win32
if "%PLATFORM%" == "arm64" set FB_VS_ARCH=arm64
if "%PLATFORM%" == "arm64" set FB_PROCESSOR_ARCHITECTURE=ARM64
if not "%PLATFORM%" == "x86" set FB_LIBRARY_PLATFORM=%PLATFORM%
echo FB_VS_ARCH=%FB_VS_ARCH%>>%GITHUB_ENV%
echo FB_PROCESSOR_ARCHITECTURE=%FB_PROCESSOR_ARCHITECTURE%>>%GITHUB_ENV%
echo FB_LIBRARY_PLATFORM=%FB_LIBRARY_PLATFORM%>>%GITHUB_ENV%
# No 5.0.4 for ARM64 in Windows yet
#- name: Firebird install
# shell: cmd
# env:
# PLATFORM: ${{ matrix.platform }}
# run: |
# set FB_ZIP=Firebird-5.0.4.1812-0-windows-%PLATFORM%.zip
# powershell Invoke-WebRequest "https://github.com/FirebirdSQL/firebird/releases/download/v5.0.4/$env:FB_ZIP" -OutFile "$env:FB_ZIP"
# 7z x -oC:\Firebird %FB_ZIP%
# echo C:\Firebird>>%GITHUB_PATH%
# set "PATH=C:\Firebird;%PATH%"
# cd /d C:\Firebird
# instreg install -z
# > init-security.sql echo create user SYSDBA password 'masterkey';
# >> init-security.sql echo quit;
# isql -user sysdba employee -i init-security.sql
# del init-security.sql
# instsvc install -z
# instsvc start
# powershell -NoProfile -Command "Start-Sleep -Seconds 2"
- name: Build
shell: cmd
env:
PLATFORM: ${{ matrix.platform }}
VS_SCRIPT: C:\Program Files\Microsoft Visual Studio\${{ (matrix.platform == 'arm64' && '2022') || '18' }}\Enterprise\Common7\Tools\VsDevCmd.bat
run: |
call "%VS_SCRIPT%" -arch=%FB_VS_ARCH%
set "PATH=%VSINSTALLDIR%VC\Tools\Llvm\x64\bin;%PATH%"
cd builds\win32
call run_all.bat CLIENT_ONLY=STATIC JUSTBUILD NOCLEAN
- name: Compile and link interface example
shell: cmd
env:
PLATFORM: ${{ matrix.platform }}
VS_SCRIPT: C:\Program Files\Microsoft Visual Studio\${{ (matrix.platform == 'arm64' && '2022') || '18' }}\Enterprise\Common7\Tools\VsDevCmd.bat
run: |
call "%VS_SCRIPT%" -arch=%FB_VS_ARCH%
cl /nologo /EHsc /MD /Isrc\include /Ioutput_%FB_LIBRARY_PLATFORM%_release\include examples\interfaces\01.create.cpp output_%FB_LIBRARY_PLATFORM%_release\lib\fbclient_static_ms.lib extern\libtommath\lib\%FB_LIBRARY_PLATFORM%\Release\tommath.lib extern\libtomcrypt\lib\%FB_LIBRARY_PLATFORM%\Release\tomcrypt.lib advapi32.lib bcrypt.lib legacy_stdio_definitions.lib mpr.lib ole32.lib psapi.lib shell32.lib user32.lib ws2_32.lib /Fe:%TEMP%\01.create.exe
# No 5.0.4 for ARM64 in Windows yet
#- name: Run interface example
# shell: cmd
# run: |
# set "PATH=C:\Firebird;%PATH%"
# if not exist C:\Windows\Temp\firebird-static mkdir C:\Windows\Temp\firebird-static
# set ISC_PATH=localhost:C:/Windows/Temp/firebird-static
# "%TEMP%\01.create.exe"
- name: Upload static library
uses: actions/upload-artifact@v4
with:
name: firebird-windows-${{ matrix.platform }}-static-client
path: output_${{ env.FB_LIBRARY_PLATFORM }}_release\lib\fbclient_static_ms.lib