Skip to content

Commit e63f285

Browse files
authored
ci: refactor release flow for bindings (#741)
1 parent 3d82ab7 commit e63f285

File tree

4 files changed

+47
-39
lines changed

4 files changed

+47
-39
lines changed

.github/workflows/bindings.nodejs.yml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
11
name: Bindings Node.js
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
tags:
8-
- v*
9-
pull_request:
10-
branches:
11-
- main
12-
paths:
13-
- "core/**"
14-
- "sql/**"
15-
- "driver/**"
16-
- "bindings/nodejs/**"
17-
- ".github/workflows/bindings.nodejs.yml"
18-
19-
concurrency:
20-
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
21-
cancel-in-progress: true
4+
workflow_call:
5+
inputs:
6+
publish:
7+
description: 'Whether to publish to npm'
8+
type: boolean
9+
required: false
10+
default: false
2211

2312
jobs:
2413
check:
@@ -131,7 +120,7 @@ jobs:
131120
- run: make -C tests test-bindings-nodejs
132121

133122
publish:
134-
if: startsWith(github.ref, 'refs/tags/v')
123+
if: inputs.publish == true
135124
needs: [build, integration]
136125
runs-on: ubuntu-latest
137126
permissions:

.github/workflows/bindings.python.yml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
11
name: Bindings Python
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
tags:
8-
- v*
9-
pull_request:
10-
branches:
11-
- main
12-
paths:
13-
- "core/**"
14-
- "sql/**"
15-
- "driver/**"
16-
- "bindings/python/**"
17-
- ".github/workflows/bindings.python.yml"
18-
19-
concurrency:
20-
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
21-
cancel-in-progress: true
4+
workflow_call:
5+
inputs:
6+
publish:
7+
description: 'Whether to publish to PyPI'
8+
type: boolean
9+
required: false
10+
default: false
2211

2312
jobs:
2413
check:
@@ -208,7 +197,7 @@ jobs:
208197

209198

210199
publish:
211-
if: startsWith(github.ref, 'refs/tags/v')
200+
if: inputs.publish == true
212201
needs: [check, build, integration]
213202
runs-on: ubuntu-latest
214203
permissions:

.github/workflows/ci.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
concurrency:
1010
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
11-
cancel-in-progress: true
11+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
1212

1313
jobs:
1414
check:
@@ -89,3 +89,17 @@ jobs:
8989
- run: make -C tests test-core
9090
- run: make -C tests test-driver
9191
- run: make -C tests test-bendsql
92+
93+
bindings_python:
94+
needs: check
95+
uses: ./.github/workflows/bindings.python.yml
96+
with:
97+
publish: false
98+
secrets: inherit
99+
100+
bindings_nodejs:
101+
needs: check
102+
uses: ./.github/workflows/bindings.nodejs.yml
103+
with:
104+
publish: false
105+
secrets: inherit

.github/workflows/release.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,19 @@ jobs:
244244
GH_TOKEN: ${{ github.token }}
245245
run: |
246246
gh release upload ${{ needs.check.outputs.new_version }} dist/pkg/* --clobber
247+
248+
bindings_python:
249+
needs: [check, build_linux]
250+
if: needs.check.outputs.version_changed == 'true'
251+
uses: ./.github/workflows/bindings.python.yml
252+
with:
253+
publish: true
254+
secrets: inherit
255+
256+
bindings_nodejs:
257+
needs: [check, build_linux]
258+
if: needs.check.outputs.version_changed == 'true'
259+
uses: ./.github/workflows/bindings.nodejs.yml
260+
with:
261+
publish: true
262+
secrets: inherit

0 commit comments

Comments
 (0)