Repository navigation
454 lines (394 loc) · 15.9 KB
/
Copy pathWindows.yml
File metadata and controls
454 lines (394 loc) · 15.9 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
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
name: Windows
on:
workflow_call:
inputs:
duckdb_version:
type: string
duckdb_commit:
type: string
skip_tests:
type: boolean
run_all:
type: boolean
runners:
type: string
runner_provider:
type: string
required: true
concurrency:
group: windows-${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ github.ref != 'refs/heads/main' || github.sha }}-${{ inputs.duckdb_version }}
cancel-in-progress: true
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
DUCKDB_VERSION: ${{ inputs.duckdb_version }}
DUCKDB_COMMIT: ${{ inputs.duckdb_commit }}
AZURE_CODESIGN_ENDPOINT: https://eus.codesigning.azure.net/
AZURE_CODESIGN_ACCOUNT: duckdb-signing-2
AZURE_CODESIGN_PROFILE: duckdb-certificate-profile
jobs:
win-release-64:
# Builds binaries for windows_amd64
name: Windows (64 Bit)
runs-on: ${{ fromJSON(inputs.runners).windows_2022_x64 || 'windows-2022' }}
env:
GEN: ninja
CC: clang-cl
CXX: clang-cl
steps:
- name: "Checkout"
uses: duckdb/duckdb-ci/.github/actions/checkout@main
with:
runner_provider: ${{ inputs.runner_provider }}
fetch_depth: 0
ref: ${{ inputs.duckdb_commit }}
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- uses: ./.github/actions/ccache-action
- name: Set up MSVC environment (x64)
uses: ./.github/actions/setup-msvc-env
- name: Build
shell: bash
run: |
clang-cl --version
python scripts/ci/retry.py -- python scripts/windows_ci.py
python scripts/ci/retry.py -- make windows_release
- name: Verify architecture flags
shell: pwsh
run: |
$commands = Get-Content compile_commands.json -Raw
if (!$commands.Contains('clang-cl')) {
throw 'Windows amd64 Release compile commands are not using clang-cl'
}
if (!$commands.Contains('-march=haswell') -or !$commands.Contains('-mtune=generic')) {
throw 'Windows amd64 Release compile commands are missing the CLI architecture flags'
}
- name: Set DUCKDB_INSTALL_LIB for ADBC tests
shell: pwsh
run: echo "DUCKDB_INSTALL_LIB=$((Get-ChildItem -Recurse -Filter "duckdb.dll" | Select-Object -First 1).FullName)" >> $env:GITHUB_ENV
- name: Test DUCKDB_INSTALL_LIB variable
shell: bash
run: echo "$DUCKDB_INSTALL_LIB"
- name: Test
shell: bash
if: ${{ !inputs.skip_tests }}
run: |
python test/run.py
- name: Test with VS2019 C++ stdlib
shell: bash
if: ${{ !inputs.skip_tests }}
run: |
python scripts/ci/retry.py -- curl -L --output ./test/msvcp140.dll https://blobs.duckdb.org/ci/msvcp140.dll
ls ./test
python test/run.py
rm ./test/msvcp140.dll
- name: Tools Test
shell: bash
if: ${{ !inputs.skip_tests }}
run: |
python scripts/ci/retry.py -- python -m pip install pytest
python -m pytest tools/shell/tests --shell-binary duckdb.exe
- name: Sign files with Azure Trusted Signing (TM)
if: github.repository == 'duckdb/duckdb' && github.event_name != 'pull_request'
uses: azure/trusted-signing-action@v0
with:
azure-tenant-id: ${{ secrets.AZURE_CODESIGN_TENANT_ID }}
azure-client-id: ${{ secrets.AZURE_CODESIGN_CLIENT_ID }}
azure-client-secret: ${{ secrets.AZURE_CODESIGN_CLIENT_SECRET }}
endpoint: ${{ env.AZURE_CODESIGN_ENDPOINT }}
trusted-signing-account-name: ${{ env.AZURE_CODESIGN_ACCOUNT }}
certificate-profile-name: ${{ env.AZURE_CODESIGN_PROFILE }}
files-folder: ${{ github.workspace }}
files-folder-filter: exe,dll
files-folder-recurse: true
file-digest: SHA256
timestamp-rfc3161: http://timestamp.acs.microsoft.com
timestamp-digest: SHA256
- name: CLI check
shell: bash
run: |
./duckdb.exe -c "PRAGMA platform; PRAGMA version;"
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
# Fail on a zero major version.
./duckdb.exe -ascii -noheader -c "SELECT library_version FROM pragma_version() WHERE library_version NOT LIKE 'v0%'" | grep '^v';
fi
- name: Deploy
shell: bash
env:
AWS_ENDPOINT_URL: ${{ secrets.S3_DUCKDB_STAGING_ENDPOINT }}
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }}
run: |
make cli-release-artifact ARTIFACT_SUFFIX=windows-amd64 CLI_BINARY=duckdb.exe
make shared-libs-release-artifact ARTIFACT_SUFFIX=windows-amd64 SHARED_LIBRARIES="src/duckdb.dll src/duckdb.lib"
make static-libs-release-artifact ARTIFACT_SUFFIX=windows-amd64 STATIC_LIBRARIES="src/duckdb_static.lib src/duckdb_shell.lib src/main/http/duckdb_httplib.lib src/main/extension/duckdb_loadable_extensions.lib extension/*/*_extension.lib"
./scripts/upload-assets-to-staging.sh github_release duckdb-cli-windows-amd64.tar.gz duckdb-shared-libs-windows-amd64.tar.gz duckdb-static-libs-windows-amd64.tar.gz
- uses: actions/upload-artifact@v7
with:
path: duckdb-cli-windows-amd64.tar.gz
archive: false
- uses: actions/upload-artifact@v7
with:
path: duckdb-shared-libs-windows-amd64.tar.gz
archive: false
- uses: actions/upload-artifact@v7
with:
path: duckdb-static-libs-windows-amd64.tar.gz
archive: false
- uses: actions/upload-artifact@v7
with:
name: release-core-extensions-windows-amd64
path: repository
if-no-files-found: error
- name: Package release artifact
shell: bash
run: make release-artifact RELEASE_ARTIFACT_SOURCE_DIR=. RELEASE_ARTIFACT_TARBALL=build/windows-release-amd64-build.tar.gz
- uses: actions/upload-artifact@v7
with:
path: build/windows-release-amd64-build.tar.gz
if-no-files-found: error
archive: false
win-release-32:
name: Windows (32 Bit)
needs:
- win-release-64
if: ${{ github.ref_name == 'main' || github.repository != 'duckdb/duckdb' || inputs.run_all }}
runs-on: ${{ fromJSON(inputs.runners).windows_2022_x64 || 'windows-2022' }}
env:
GEN: ninja
CC: clang-cl
CXX: clang-cl
EXTRA_CMAKE_VARIABLES: -DCMAKE_C_COMPILER_TARGET=i686-pc-windows-msvc -DCMAKE_CXX_COMPILER_TARGET=i686-pc-windows-msvc
steps:
- name: "Checkout"
uses: duckdb/duckdb-ci/.github/actions/checkout@main
with:
runner_provider: ${{ inputs.runner_provider }}
fetch_depth: 0
ref: ${{ inputs.duckdb_commit }}
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- uses: ./.github/actions/ccache-action
- name: Set up MSVC environment (x86 target)
uses: ./.github/actions/setup-msvc-env
with:
arch: x86
host_arch: x64
- name: Build
shell: bash
run: |
clang-cl --version
python scripts/ci/retry.py -- make windows_release_32
- name: Verify compiler
shell: pwsh
run: |
$commands = Get-Content compile_commands.json -Raw
if (!$commands.Contains('clang-cl')) {
throw 'Windows 32-bit compile commands are not using clang-cl'
}
- name: Test
shell: bash
if: ${{ !inputs.skip_tests }}
run: python test/run.py
- name: Tools Test
shell: bash
if: ${{ !inputs.skip_tests }}
run: |
python scripts/ci/retry.py -- python -m pip install pytest
python -m pytest tools/shell/tests --shell-binary duckdb.exe
win-release-arm64:
name: Windows (ARM64)
needs:
- win-release-64
if: ${{ github.ref_name == 'main' || github.repository != 'duckdb/duckdb' || inputs.run_all }}
runs-on: windows-2025-vs2026
env:
GEN: ninja
CC: clang-cl
CXX: clang-cl
EXTRA_CMAKE_VARIABLES: -DCMAKE_C_COMPILER_TARGET=arm64-pc-windows-msvc -DCMAKE_CXX_COMPILER_TARGET=arm64-pc-windows-msvc
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ inputs.duckdb_commit }}
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- uses: ./.github/actions/ccache-action
- name: Set up MSVC environment (arm64 target)
uses: ./.github/actions/setup-msvc-env
with:
arch: arm64
host_arch: x64
- name: Build
shell: bash
run: |
clang-cl --version
python scripts/ci/retry.py -- make DUCKDB_PLATFORM=windows_arm64 windows_release
- name: Verify architecture flags
shell: pwsh
run: |
$commands = Get-Content compile_commands.json -Raw
if (!$commands.Contains('clang-cl')) {
throw 'Windows ARM64 Release compile commands are not using clang-cl'
}
if (!$commands.Contains('-march=armv8-a') -or !$commands.Contains('-mtune=generic')) {
throw 'Windows ARM64 Release compile commands are missing the architecture flags'
}
- name: Sign files with Azure Trusted Signing (TM)
if: github.repository == 'duckdb/duckdb' && github.event_name != 'pull_request'
uses: azure/trusted-signing-action@v0
with:
azure-tenant-id: ${{ secrets.AZURE_CODESIGN_TENANT_ID }}
azure-client-id: ${{ secrets.AZURE_CODESIGN_CLIENT_ID }}
azure-client-secret: ${{ secrets.AZURE_CODESIGN_CLIENT_SECRET }}
endpoint: ${{ env.AZURE_CODESIGN_ENDPOINT }}
trusted-signing-account-name: ${{ env.AZURE_CODESIGN_ACCOUNT }}
certificate-profile-name: ${{ env.AZURE_CODESIGN_PROFILE }}
files-folder: ${{ github.workspace }}
files-folder-filter: exe,dll
files-folder-recurse: true
file-digest: SHA256
timestamp-rfc3161: http://timestamp.acs.microsoft.com
timestamp-digest: SHA256
- name: Deploy
shell: bash
env:
AWS_ENDPOINT_URL: ${{ secrets.S3_DUCKDB_STAGING_ENDPOINT }}
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }}
run: |
make cli-release-artifact ARTIFACT_SUFFIX=windows-arm64 CLI_BINARY=duckdb.exe
make shared-libs-release-artifact ARTIFACT_SUFFIX=windows-arm64 SHARED_LIBRARIES="src/duckdb.dll src/duckdb.lib"
make static-libs-release-artifact ARTIFACT_SUFFIX=windows-arm64 STATIC_LIBRARIES="src/duckdb_static.lib src/duckdb_shell.lib src/main/http/duckdb_httplib.lib src/main/extension/duckdb_loadable_extensions.lib extension/*/*_extension.lib"
./scripts/upload-assets-to-staging.sh github_release duckdb-cli-windows-arm64.tar.gz duckdb-shared-libs-windows-arm64.tar.gz duckdb-static-libs-windows-arm64.tar.gz
- uses: actions/upload-artifact@v7
with:
path: duckdb-cli-windows-arm64.tar.gz
archive: false
- uses: actions/upload-artifact@v7
with:
path: duckdb-shared-libs-windows-arm64.tar.gz
archive: false
- uses: actions/upload-artifact@v7
with:
path: duckdb-static-libs-windows-arm64.tar.gz
archive: false
- uses: actions/upload-artifact@v7
with:
name: release-core-extensions-windows-arm64
path: repository
if-no-files-found: error
- name: Package release artifact
shell: bash
run: make release-artifact RELEASE_ARTIFACT_SOURCE_DIR=. RELEASE_ARTIFACT_TARBALL=build/windows-release-arm64-build.tar.gz
- uses: actions/upload-artifact@v7
with:
path: build/windows-release-arm64-build.tar.gz
if-no-files-found: error
archive: false
mingw:
name: MinGW (64 Bit)
needs:
- win-release-64
runs-on: ${{ fromJSON(inputs.runners).windows_2022_x64 || 'windows-2022' }}
env:
GEN: ninja
CC: C:/rtools42/x86_64-w64-mingw32.static.posix/bin/gcc.exe
CXX: C:/rtools42/x86_64-w64-mingw32.static.posix/bin/g++.exe
EXTENSION_CONFIGS: '${GITHUB_WORKSPACE}/.github/config/bundled_extensions.cmake'
DUCKDB_CAPABILITIES: 'httplib loadable_extensions'
steps:
- name: "Checkout"
uses: duckdb/duckdb-ci/.github/actions/checkout@main
with:
runner_provider: ${{ inputs.runner_provider }}
ref: ${{ inputs.duckdb_commit }}
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Setup Rtools
uses: r-lib/actions/setup-r@d3c5be51b12e724e68f33216ca3c148b66d5f0b6 # v2.12.1
with:
r-version: devel
update-rtools: true
rtools-version: '42'
- name: Dependencies
shell: bash
run: |
python scripts/ci/retry.py -- choco install \
ccache \
make \
--no-progress
- uses: ./.github/actions/ccache-action
- name: Build Environment
shell: bash
run: |
{
# bash from Git
echo 'C:/Program Files/Git/bin'
# make, ninja and ccache from Chocolatey
echo 'C:/ProgramData/Chocolatey/bin'
# gcc and g++ from Rtools42
echo 'C:/rtools42/x86_64-w64-mingw32.static.posix/bin'
} >> "${GITHUB_PATH}"
- name: Build Environment Check
shell: bash
run: |
where bash
bash --version
where make
make --version
where ninja
ninja --version
where ccache
ccache --version
where g++
g++ --version
echo %PATH%
- name: MinGW Runtime Diagnostics
shell: bash
run: |
set -x
echo "PWD=$PWD"
echo "PATH=$PATH"
where python
python --version
echo "Nearby DLLs and EXEs:"
find build/release -maxdepth 3 \( -name '*.dll' -o -name '*.exe' \) | sort || true
/c/Windows/System32/cmd.exe /c "where libstdc++-6.dll" || true
/c/Windows/System32/cmd.exe /c "where libgcc_s_seh-1.dll" || true
/c/Windows/System32/cmd.exe /c "where libwinpthread-1.dll" || true
- name: Build
run: python scripts/ci/retry.py -- make release
- name: Test
if: ${{ !inputs.skip_tests }}
run: python build/release/test/run.py
- name: Deploy static libraries
shell: bash
env:
AWS_ENDPOINT_URL: ${{ secrets.S3_DUCKDB_STAGING_ENDPOINT }}
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }}
run: |
make static-libs-release-artifact ARTIFACT_SUFFIX=windows-mingw STATIC_LIBRARIES="build/release/src/libduckdb_static.a build/release/src/libduckdb_shell.a build/release/src/main/http/libduckdb_httplib.a build/release/src/main/extension/libduckdb_loadable_extensions.a build/release/extension/*/lib*_extension.a"
./scripts/upload-assets-to-staging.sh github_release duckdb-static-libs-windows-mingw.tar.gz
- uses: actions/upload-artifact@v7
with:
path: duckdb-static-libs-windows-mingw.tar.gz
archive: false
- uses: actions/upload-artifact@v7
with:
name: release-core-extensions-windows-mingw
path: build/release/repository
if-no-files-found: error
- name: Package release artifact
shell: bash
run: make release-artifact RELEASE_ARTIFACT_TARBALL=build/windows-release-mingw-build.tar.gz
- uses: actions/upload-artifact@v7
with:
path: build/windows-release-mingw-build.tar.gz
if-no-files-found: error
archive: false