-
Notifications
You must be signed in to change notification settings - Fork 1
200 lines (169 loc) · 5.9 KB
/
NodeJS.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
name: DuckDB Node Client API
on:
push:
pull_request:
workflow_dispatch:
inputs:
publish_dry_run:
description: 'Publish Dry Run'
type: boolean
required: true
default: true
linux:
description: 'Run on Linux'
type: boolean
required: true
default: false
publish_linux_x64:
description: 'Publish Bindings for Linux x64'
type: boolean
required: true
default: false
publish_bindings:
description: 'Publish Bindings (from Linux)'
type: boolean
required: true
default: false
publish_api:
description: 'Publish API (from Linux)'
type: boolean
required: true
default: false
macos:
description: 'Run on Mac OS'
type: boolean
required: true
default: false
publish_darwin_arm64:
description: 'Publish Bindings for Darwin ARM64'
type: boolean
required: true
default: false
windows:
description: 'Run on Windows'
type: boolean
required: true
default: false
publish_win32_x64:
description: 'Publish Bindings for Win32 x64'
type: boolean
required: true
default: false
repository_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ github.ref != 'refs/heads/main' || github.sha }}
cancel-in-progress: false
jobs:
linux:
name: Linux
runs-on: ubuntu-latest
if: ${{ github.event_name != 'workflow_dispatch' || inputs.linux }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: alt
- uses: pnpm/action-setup@v3
with:
version: 9
- name: Workspace - Install
working-directory: alt
run: pnpm install
- name: Bindings - Build
working-directory: alt/bindings
run: pnpm run build
- name: Bindings - Test
working-directory: alt/bindings
run: pnpm test
- name: API - Build
working-directory: alt/api
run: pnpm run build
- name: API - Test
working-directory: alt/api
run: pnpm test
- name: Publish - Config Auth Token
if: ${{ inputs.publish_linux_x64 || inputs.publish_bindings || inputs.publish_api }}
run: pnpm config set '//npm.pkg.github.com/:_authToken' "${NPM_AUTH_TOKEN}"
env:
NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish - Bindings - Linux x64
if: ${{ inputs.publish_linux_x64 }}
working-directory: alt/bindings/pkgs/@duckdb/node-bindings-linux-x64
run: pnpm publish ${{ inputs.publish_dry_run && '--dry-run' || '' }} --publish-branch ${{ github.ref_name }}
- name: Publish - Bindings
if: ${{ inputs.publish_bindings }}
working-directory: alt/bindings/pkgs/@duckdb/node-bindings
run: pnpm publish ${{ inputs.publish_dry_run && '--dry-run' || '' }} --publish-branch ${{ github.ref_name }}
- name: Publish - API
if: ${{ inputs.publish_api }}
working-directory: alt/api/pkgs/@duckdb/node-api
run: pnpm publish ${{ inputs.publish_dry_run && '--dry-run' || '' }} --publish-branch ${{ github.ref_name }}
macos:
name: Mac OS X
runs-on: macos-latest
if: ${{ github.event_name != 'workflow_dispatch' || inputs.macos }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: alt
- uses: pnpm/action-setup@v3
with:
version: 9
- name: Workspace - Install
working-directory: alt
run: pnpm install
- name: Bindings - Build
working-directory: alt/bindings
run: pnpm run build
- name: Bindings - Test
working-directory: alt/bindings
run: pnpm test
- name: API - Build
working-directory: alt/api
run: pnpm run build
- name: API - Test
working-directory: alt/api
run: pnpm test
- name: Publish - Config Auth Token
if: ${{ inputs.publish_darwin_arm64 }}
run: pnpm config set '//npm.pkg.github.com/:_authToken' "${NPM_AUTH_TOKEN}"
env:
NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish - Bindings - Darwin ARM64
if: ${{ inputs.publish_darwin_arm64 }}
working-directory: alt/bindings/pkgs/@duckdb/node-bindings-darwin-arm64
run: pnpm publish ${{ inputs.publish_dry_run && '--dry-run' || '' }} --publish-branch ${{ github.ref_name }}
windows:
name: Windows
runs-on: windows-latest
if: ${{ github.event_name != 'workflow_dispatch' || inputs.windows }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: alt
- uses: pnpm/action-setup@v3
with:
version: 9
- name: Workspace - Install
working-directory: alt
run: pnpm install
- name: Bindings - Build
working-directory: alt/bindings
run: pnpm run build
- name: Bindings - Test
working-directory: alt/bindings
run: pnpm test
- name: API - Build
working-directory: alt/api
run: pnpm run build
- name: API - Test
working-directory: alt/api
run: pnpm test
- name: Publish - Config Auth Token
if: ${{ inputs.publish_win32_x64 }}
run: pnpm config set '//npm.pkg.github.com/:_authToken' "${NPM_AUTH_TOKEN}"
env:
NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish - Bindings - Win32 x64
if: ${{ inputs.publish_win32_x64 }}
working-directory: alt/bindings/pkgs/@duckdb/node-bindings-win32-x64
run: pnpm publish ${{ inputs.publish_dry_run && '--dry-run' || '' }} --publish-branch ${{ github.ref_name }}