-
Notifications
You must be signed in to change notification settings - Fork 103
250 lines (201 loc) · 7.67 KB
/
build-extensions.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
name: Build-Extensions
on: workflow_dispatch
jobs:
build-linux-extensions-x86_64:
runs-on: kuzu-self-hosted-linux-building-x86_64
steps:
- uses: actions/checkout@v4
- name: Build precompiled extensions
run: make extension-release NUM_THREADS=$(nproc)
- name: Collect built artifacts
run: /opt/python/cp310-cp310/bin/python scripts/collect-extensions.py
- name: Upload built artifacts
uses: actions/upload-artifact@v4
with:
name: kuzu-extensions_linux-x86_64
path: extension-artifacts
build-linux-extensions-aarch64:
runs-on: kuzu-self-hosted-linux-building-aarch64
steps:
- uses: actions/checkout@v4
- name: Build precompiled extensions
run: make extension-release NUM_THREADS=$(nproc)
- name: Collect built artifacts
run: /opt/python/cp310-cp310/bin/python scripts/collect-extensions.py
- name: Upload built artifacts
uses: actions/upload-artifact@v4
with:
name: kuzu-extensions_linux-aarch64
path: extension-artifacts
build-linux-extensions-x86:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Start Docker container
run: |
docker run -d --name kuzu-x86 \
-v $PWD:/kuzu -w /kuzu \
-e NUM_THREADS=$(nproc) -e CC=gcc -e CXX=g++ \
i386/debian:stable tail -f /dev/null
- name: Install dependencies
run: |
docker exec kuzu-x86 apt-get update
docker exec kuzu-x86 apt-get install -y git python3 ninja-build build-essential cmake libssl-dev
- name: Build precompiled extensions
run: |
docker exec kuzu-x86 make extension-release NUM_THREADS=$(nproc)
- name: Collect built artifacts
run: |
python3 scripts/collect-extensions.py
sudo chown -R $USER:$USER extension-artifacts
sudo chmod -R 755 extension-artifacts
- name: Upload built artifacts
uses: actions/upload-artifact@v4
with:
name: kuzu-extensions_linux-x86
path: extension-artifacts
- name: Stop Docker container
run: docker stop kuzu-x86
build-mac-extensions-arm64:
runs-on: self-hosted-mac-arm
steps:
- uses: actions/checkout@v4
- name: Build precompiled extensions
run: env OPENSSL_ROOT_DIR=/opt/homebrew/Cellar/openssl@3/3.3.0 make extension-release NUM_THREADS=$(sysctl -n hw.logicalcpu)
env:
MACOSX_DEPLOYMENT_TARGET: 11.0
CMAKE_OSX_ARCHITECTURES: "arm64"
- name: Collect built artifacts
run: python3 scripts/collect-extensions.py
- name: Upload built artifacts
uses: actions/upload-artifact@v4
with:
name: kuzu-extensions_osx-arm64
path: extension-artifacts
build-mac-extensions-x86_64:
runs-on: self-hosted-mac-x64
steps:
- uses: actions/checkout@v4
- name: Build precompiled extensions
run: make extension-release NUM_THREADS=$(sysctl -n hw.logicalcpu)
env:
MACOSX_DEPLOYMENT_TARGET: 11.0
CMAKE_OSX_ARCHITECTURES: "x86_64"
- name: Collect built artifacts
run: python3 scripts/collect-extensions.py
- name: Upload built artifacts
uses: actions/upload-artifact@v4
with:
name: kuzu-extensions_osx-x86_64
path: extension-artifacts
build-windows-extensions-x86_64:
runs-on: self-hosted-windows
env:
NUM_THREADS: 18
steps:
- uses: actions/checkout@v4
- name: Build precompiled extensions
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
make extension-release
- name: Collect built artifacts
run: python scripts/collect-extensions.py
- name: Upload built artifacts
uses: actions/upload-artifact@v4
with:
name: kuzu-extensions_win-x86_64
path: extension-artifacts
update-extensions-repo:
runs-on: ubuntu-latest
needs:
- build-linux-extensions-x86_64
- build-linux-extensions-aarch64
- build-linux-extensions-x86
- build-mac-extensions-arm64
- build-mac-extensions-x86_64
- build-windows-extensions-x86_64
steps:
- uses: actions/checkout@v4
- name: Detect release version
run: |
echo "RELEASE_VERSION=v$(cat CMakeLists.txt | grep "DKUZU_EXTENSION_VERSION" | cut -d '"' -f 2 )" >> $GITHUB_ENV
- name: Delete checked out repository
run: cd .. && rm -rf kuzudb
- uses: actions/checkout@v4
with:
repository: kuzudb/extension
token: ${{ secrets.DOC_PUSH_TOKEN }}
- name: Clear old artifacts
run: |
rm -rf releases/$RELEASE_VERSION/
- name: Create temporary directory for artifacts
run: |
mkdir -p extension-artifacts
mkdir -p extension-artifacts/linux_amd64
mkdir -p extension-artifacts/linux_arm64
mkdir -p extension-artifacts/linux_x86
mkdir -p extension-artifacts/osx_amd64
mkdir -p extension-artifacts/osx_arm64
mkdir -p extension-artifacts/win_amd64
- name: Download built artifacts for linux-x86_64
uses: actions/download-artifact@v4
with:
name: kuzu-extensions_linux-x86_64
path: extension-artifacts/linux_amd64
- name: Download built artifacts for linux-aarch64
uses: actions/download-artifact@v4
with:
name: kuzu-extensions_linux-aarch64
path: extension-artifacts/linux_arm64
- name: Download built artifacts for linux-x86
uses: actions/download-artifact@v4
with:
name: kuzu-extensions_linux-x86
path: extension-artifacts/linux_x86
- name: Download built artifacts for osx-x86_64
uses: actions/download-artifact@v4
with:
name: kuzu-extensions_osx-x86_64
path: extension-artifacts/osx_amd64
- name: Download built artifacts for osx-aarch64
uses: actions/download-artifact@v4
with:
name: kuzu-extensions_osx-arm64
path: extension-artifacts/osx_arm64
- name: Download built artifacts for windows-x86_64
uses: actions/download-artifact@v4
with:
name: kuzu-extensions_win-x86_64
path: extension-artifacts/win_amd64
- name: Copy built artifacts
run: |
rsync -av extension-artifacts/ releases/$RELEASE_VERSION/
- name: Remove temporary directory
run: rm -rf extension-artifacts
- name: Set artifact permissions
run: |
chmod -R 755 releases/$RELEASE_VERSION
- name: List downloaded artifacts
run: ls -R releases/$RELEASE_VERSION
- name: Push changes
run: |
git checkout -b "extensions-update-${{ github.sha }}"
git config --global user.name "CI User"
git config --global user.email "[email protected]"
git add -A
git commit -m "Update extensions (CI) - $RELEASE_VERSION"
git push -u origin "extensions-update-${{ github.sha }}"
- name: Create pull request
run: |
echo "${{ secrets.DOC_PUSH_TOKEN }}" > token.txt
gh auth login --with-token < token.txt
rm -rf token.txt
gh pr create \
--body "Action triggered by CI workflow." \
--title "Update extensions (CI) - $RELEASE_VERSION" \
--head "extensions-update-${{ github.sha }}" \
--base "main"
- name: Merge pull request
run: |
gh pr merge --auto --squash --delete-branch