forked from duckdb/duckdb
-
Notifications
You must be signed in to change notification settings - Fork 0
246 lines (222 loc) · 8.39 KB
/
BundleStaticLibs.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
name: Bundle Static Libraries
on:
workflow_call:
inputs:
override_git_describe:
type: string
git_ref:
type: string
skip_tests:
type: string
workflow_dispatch:
inputs:
override_git_describe:
type: string
git_ref:
type: string
skip_tests:
type: string
push:
branches-ignore:
- 'main'
- 'feature'
- 'v*.*-*'
paths-ignore:
- '**'
- '!.github/workflows/BundleStaticLibs.yml'
pull_request:
types: [opened, reopened, ready_for_review]
paths-ignore:
- '**'
- '!.github/workflows/BundleStaticLibs.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ github.ref != 'refs/heads/main' || github.sha }}-${{ inputs.override_git_describe }}
cancel-in-progress: true
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
OVERRIDE_GIT_DESCRIBE: ${{ inputs.override_git_describe }}
jobs:
bundle-osx-static-libs:
name: OSX static libs
strategy:
matrix:
include:
- version: "macos-13"
architecture: "amd64"
- version: "macos-14"
architecture: "arm64"
runs-on: ${{ matrix.version }}
env:
EXTENSION_CONFIGS: '${GITHUB_WORKSPACE}/.github/config/bundled_extensions.cmake'
ENABLE_EXTENSION_AUTOLOADING: 1
ENABLE_EXTENSION_AUTOINSTALL: 1
GEN: ninja
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.git_ref }}
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Ninja
run: brew install ninja
- name: Setup Ccache
uses: hendrikmuhs/ccache-action@main
with:
key: ${{ github.job }}
save: ${{ github.ref == 'refs/heads/main' || github.repository != 'duckdb/duckdb' }}
- name: Build
shell: bash
run: make
- name: Bundle static library
shell: bash
run: make bundle-library-o
- name: Print platform
shell: bash
run: ./build/release/duckdb -c "PRAGMA platform;"
- name: Deploy
shell: bash
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }}
run: |
python3 scripts/amalgamation.py
zip -j static-lib-osx-${{ matrix.architecture }}.zip src/include/duckdb.h build/release/libduckdb_bundle.a
./scripts/upload-assets-to-staging.sh github_release static-lib-osx-${{ matrix.architecture }}.zip
- uses: actions/upload-artifact@v4
with:
name: duckdb-static-lib-osx-${{ matrix.architecture }}
path: |
static-lib-osx-${{ matrix.architecture }}.zip
bundle-mingw-static-lib:
name: Windows MingW static libs
runs-on: windows-2019
env:
ENABLE_EXTENSION_AUTOLOADING: 1
ENABLE_EXTENSION_AUTOINSTALL: 1
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.git_ref }}
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: r-lib/actions/setup-r@v2
with:
r-version: 'devel'
update-rtools: true
rtools-version: '42' # linker bug in 43 ^^
- uses: ./.github/actions/build_extensions
with:
duckdb_arch: windows_amd64_mingw
vcpkg_target_triplet: x64-mingw-static
treat_warn_as_error: 0
override_cc: gcc
override_cxx: g++
vcpkg_build: 1
no_static_linking: 0
run_tests: 0
run_autoload_tests: 0
build_in_tree_extensions: 0
build_out_of_tree_extensions: 0
bundle_static_lib_mode: 1
- name: Bundle static library
shell: bash
run: |
make bundle-library-obj
- name: Deploy
shell: bash
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }}
run: |
zip -j static-lib-windows-mingw.zip src/include/duckdb.h build/release/libduckdb_bundle.a
./scripts/upload-assets-to-staging.sh github_release static-lib-windows-mingw.zip
- uses: actions/upload-artifact@v4
with:
name: duckdb-static-lib-windows-mingw
path: |
static-lib-windows-mingw.zip
bundle-linux-arm64-static-libs:
name: Linux arm64 static libs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.git_ref }}
- name: Build
shell: bash
run: |
docker run \
-v.:/duckdb \
-e CC=aarch64-linux-gnu-gcc \
-e CXX=aarch64-linux-gnu-g++ \
-e CMAKE_BUILD_PARALLEL_LEVEL=2 \
-e OVERRIDE_GIT_DESCRIBE=$OVERRIDE_GIT_DESCRIBE \
-e EXTENSION_CONFIGS='/duckdb/.github/config/bundled_extensions.cmake' \
-e ENABLE_EXTENSION_AUTOLOADING=1 \
-e ENABLE_EXTENSION_AUTOINSTALL=1 \
-e FORCE_WARN_UNUSED=1 \
-e DUCKDB_PLATFORM=linux_arm64 \
ubuntu:18.04 \
bash -c "/duckdb/scripts/setup_ubuntu1804.sh && git config --global --add safe.directory /duckdb && make bundle-library -C /duckdb"
- name: Deploy
shell: bash
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }}
run: |
python3 scripts/amalgamation.py
zip -j static-lib-linux-arm64.zip src/include/duckdb.h build/release/libduckdb_bundle.a
./scripts/upload-assets-to-staging.sh github_release static-lib-linux-arm64.zip
- uses: actions/upload-artifact@v4
with:
name: duckdb-static-lib-linux-arm64
path: |
static-lib-linux-arm64.zip
bundle-linux-amd64-static-libs:
name: Linux amd64 static libs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.git_ref }}
- name: Install pytest
run: |
python3 -m pip install pytest
- name: Build
shell: bash
run: |
export PWD=`pwd`
docker run \
-v$PWD:$PWD \
-e CMAKE_BUILD_PARALLEL_LEVEL=2 \
-e OVERRIDE_GIT_DESCRIBE=$OVERRIDE_GIT_DESCRIBE \
-e EXTENSION_CONFIGS="$PWD/.github/config/bundled_extensions.cmake" \
-e ENABLE_EXTENSION_AUTOLOADING=1 \
-e ENABLE_EXTENSION_AUTOINSTALL=1 \
-e BUILD_BENCHMARK=1 \
-e FORCE_WARN_UNUSED=1 \
quay.io/pypa/manylinux2014_x86_64 \
bash -c "yum install -y perl-IPC-Cmd && git config --global --add safe.directory $PWD && make bundle-library -C $PWD"
- name: Print platform
shell: bash
run: ./build/release/duckdb -c "PRAGMA platform;"
- name: Deploy
shell: bash
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }}
run: |
python3 scripts/amalgamation.py
zip -j static-lib-linux-amd64.zip src/include/duckdb.h build/release/libduckdb_bundle.a
./scripts/upload-assets-to-staging.sh github_release static-lib-linux-amd64.zip
- uses: actions/upload-artifact@v4
with:
name: duckdb-static-lib-linux-amd64
path: |
static-lib-linux-amd64.zip