-
Notifications
You must be signed in to change notification settings - Fork 85
347 lines (292 loc) · 11.1 KB
/
build-and-deploy.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
name: Build-And-Deploy
on:
schedule:
- cron: "0 8 * * *"
workflow_dispatch:
inputs:
isDeploy:
description: "Whether the build should be deployed?"
type: boolean
required: true
default: false
skipBinaries:
description: "Skip building precompiled binaries?"
type: boolean
required: true
default: false
skipJava:
description: "Skip building Java?"
type: boolean
required: true
default: false
skipNodejs:
description: "Skip building Node.js?"
type: boolean
required: true
default: false
skipPython:
description: "Skip building Python?"
type: boolean
required: true
default: false
skipRust:
description: "Skip building Rust?"
type: boolean
required: true
default: false
isNightly:
description: "Whether the build is a nightly build?"
type: boolean
required: true
default: false
jobs:
build-java-mac:
if: ${{ github.event_name == 'schedule' || github.event.inputs.skipJava != 'true' }}
uses: ./.github/workflows/mac-java-workflow.yml
secrets: inherit
build-java-linux:
if: ${{ github.event_name == 'schedule' || github.event.inputs.skipJava != 'true' }}
uses: ./.github/workflows/linux-java-workflow.yml
secrets: inherit
build-java-windows:
if: ${{ github.event_name == 'schedule' || github.event.inputs.skipJava != 'true' }}
uses: ./.github/workflows/windows-java-workflow.yml
secrets: inherit
inject-java-bins:
if: ${{ github.event_name == 'schedule' || github.event.inputs.skipJava != 'true' }}
needs: [build-java-mac, build-java-linux, build-java-windows]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: java-lib-osx-x86_64
path: java-bins
- uses: actions/download-artifact@v3
with:
name: java-lib-osx-arm64
path: java-bins
- uses: actions/download-artifact@v3
with:
name: java-lib-linux-aarch64
path: java-bins
- uses: actions/download-artifact@v3
with:
name: kuzu-linux-jar
path: java-bins
- uses: actions/download-artifact@v3
with:
name: java-lib-win-x86_64
path: java-bins
- name: Add Java libs to jar
run: |
jar uf kuzu_java.jar libkuzu_java_native.so_windows_amd64
jar uf kuzu_java.jar libkuzu_java_native.so_osx_arm64
jar uf kuzu_java.jar libkuzu_java_native.so_osx_amd64
jar uf kuzu_java.jar libkuzu_java_native.so_linux_arm64
working-directory: java-bins
- name: Upload jar
uses: actions/upload-artifact@v3
with:
name: kuzu-java-multiplatform-jar
path: java-bins/kuzu_java.jar
build-nodejs-mac:
if: ${{ github.event_name == 'schedule' || github.event.inputs.skipNodejs != 'true' }}
uses: ./.github/workflows/mac-nodejs-workflow.yml
secrets: inherit
build-nodejs-linux:
if: ${{ github.event_name == 'schedule' || github.event.inputs.skipNodejs != 'true' }}
uses: ./.github/workflows/linux-nodejs-workflow.yml
secrets: inherit
build-nodejs-windows:
if: ${{ github.event_name == 'schedule' || github.event.inputs.skipNodejs != 'true' }}
uses: ./.github/workflows/windows-nodejs-workflow.yml
secrets: inherit
deploy-nodejs:
if: ${{ github.event_name == 'schedule' || github.event.inputs.skipNodejs != 'true' }}
needs: [build-nodejs-mac, build-nodejs-linux, build-nodejs-windows]
runs-on: ubuntu-latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_JS_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: Update nightly version
if: ${{ github.event_name == 'schedule' || github.event.inputs.isNightly == 'true' }}
run: python3 update-nightly-build-version.py
working-directory: scripts
- name: Create prebuilt folder
run: mkdir -p tools/nodejs_api/prebuilt
- uses: actions/download-artifact@v3
with:
name: mac-nodejs-module-arm64
path: tools/nodejs_api/prebuilt
- uses: actions/download-artifact@v3
with:
name: mac-nodejs-module-x86_64
path: tools/nodejs_api/prebuilt
- uses: actions/download-artifact@v3
with:
name: linux-nodejs-module-x86_64
path: tools/nodejs_api/prebuilt
- uses: actions/download-artifact@v3
with:
name: linux-nodejs-module-aarch64
path: tools/nodejs_api/prebuilt
- uses: actions/download-artifact@v3
with:
name: windows-nodejs-module
path: tools/nodejs_api/prebuilt
- uses: actions/setup-node@v3
with:
node-version: "16"
registry-url: "https://registry.npmjs.org"
- name: Package Node.js API with prebuilt binaries
run: node package
working-directory: tools/nodejs_api
- name: Show tarball contents
run: tar -tvf kuzu-source.tar.gz
working-directory: tools/nodejs_api
- name: Upload tarball
uses: actions/upload-artifact@v3
with:
name: kuzu-deploy-nodejs
path: tools/nodejs_api/kuzu-source.tar.gz
- name: Deploy to npm.js dry run
if: ${{ github.event_name != 'schedule' && github.event.inputs.isDeploy != 'true' }}
run: npm publish kuzu-source.tar.gz --access public --dry-run
working-directory: tools/nodejs_api
- name: Deploy nightly to npm.js
if: ${{ github.event_name == 'schedule' || (github.event.inputs.isDeploy == 'true' && github.event.inputs.isNightly == 'true') }}
run: npm publish kuzu-source.tar.gz --access public --tag next
working-directory: tools/nodejs_api
- name: Deploy to npm.js
if: ${{ github.event.inputs.isDeploy == 'true' && github.event.inputs.isNightly != 'true' }}
run: npm publish kuzu-source.tar.gz --access public --tag latest
working-directory: tools/nodejs_api
build-wheel-mac:
if: ${{ github.event_name == 'schedule' || github.event.inputs.skipPython != 'true' }}
uses: ./.github/workflows/mac-wheel-workflow.yml
with:
isNightly: ${{ github.event_name == 'schedule' || github.event.inputs.isNightly == 'true' }}
secrets: inherit
build-wheel-linux:
if: ${{ github.event_name == 'schedule' || github.event.inputs.skipPython != 'true' }}
uses: ./.github/workflows/linux-wheel-workflow.yml
with:
isNightly: ${{ github.event_name == 'schedule' || github.event.inputs.isNightly == 'true' }}
secrets: inherit
build-wheel-windows:
if: ${{ github.event_name == 'schedule' || github.event.inputs.skipPython != 'true' }}
uses: ./.github/workflows/windows-wheel-workflow.yml
with:
isNightly: ${{ github.event_name == 'schedule' || github.event.inputs.isNightly == 'true' }}
secrets: inherit
package-python-sdist:
if: ${{ github.event_name == 'schedule' || github.event.inputs.skipPython != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Update nightly version
if: ${{ github.event_name == 'schedule' || github.event.inputs.isNightly == 'true' }}
run: python3 update-nightly-build-version.py
working-directory: scripts
- name: Package Python sdist
run: python package_tar.py
working-directory: scripts/pip-package
- name: Upload tarball
uses: actions/upload-artifact@v3
with:
name: python-sdist
path: scripts/pip-package/*.tar.gz
deploy-python:
if: ${{ github.event_name == 'schedule' || github.event.inputs.skipPython != 'true' }}
needs:
[
build-wheel-mac,
build-wheel-linux,
build-wheel-windows,
package-python-sdist,
]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: macos-wheels-arm64
path: dist
- uses: actions/download-artifact@v3
with:
name: macos-wheels-x86_64
path: dist
- uses: actions/download-artifact@v3
with:
name: linux-wheels-x86_64
path: dist
- uses: actions/download-artifact@v3
with:
name: linux-wheels-aarch64
path: dist
- uses: actions/download-artifact@v3
with:
name: windows-wheels
path: dist
- uses: actions/download-artifact@v3
with:
name: python-sdist
path: dist
- name: List wheels
run: ls -l
working-directory: dist
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: kuzu-deploy-wheels
path: dist/*
- name: Deploy to PyPI test
if: ${{ github.event_name != 'schedule' && github.event.inputs.isDeploy != 'true' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TEST_TOKEN }}
repository-url: https://test.pypi.org/legacy/
- name: Deploy to PyPI
if: ${{ github.event_name == 'schedule' || github.event.inputs.isDeploy == 'true' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
deploy-rust:
if: ${{ github.event_name == 'schedule' || github.event.inputs.skipRust != 'true' }}
runs-on: kuzu-self-hosted-testing
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: Update nightly version
if: ${{ github.event_name == 'schedule' || github.event.inputs.isNightly == 'true' }}
run: python3 update-nightly-build-version.py
working-directory: scripts
- name: Update Cargo.toml version
run: python3 update_version.py
working-directory: tools/rust_api
- name: Deploy crate to Crates.io
run: cargo publish --allow-dirty
if: ${{ github.event_name == 'schedule' || github.event.inputs.isDeploy == 'true' }}
working-directory: tools/rust_api
- name: Test publishing crate
run: cargo publish --dry-run --allow-dirty
if: ${{ github.event_name != 'schedule' && github.event.inputs.isDeploy != 'true' }}
working-directory: tools/rust_api
- name: Upload crate
uses: actions/upload-artifact@v3
with:
name: kuzu-deploy-crate
path: tools/rust_api/target/package/*.crate
build-precompiled-bin-mac:
if: ${{ github.event_name == 'schedule' || github.event.inputs.skipBinaries != 'true' }}
uses: ./.github/workflows/mac-precompiled-bin-workflow.yml
secrets: inherit
build-precompiled-bin-linux:
if: ${{ github.event_name == 'schedule' || github.event.inputs.skipBinaries != 'true' }}
uses: ./.github/workflows/linux-precompiled-bin-workflow.yml
secrets: inherit
build-precompiled-bin-windows:
if: ${{ github.event_name == 'schedule' || github.event.inputs.skipBinaries != 'true' }}
uses: ./.github/workflows/windows-precompiled-bin-workflow.yml
secrets: inherit