-
Notifications
You must be signed in to change notification settings - Fork 16
67 lines (57 loc) · 1.82 KB
/
build-python-package.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
name: Build Python Package
on:
workflow_call:
inputs:
package:
description: 'Name of the package to build'
required: true
type: string
js:
description: 'Whether to build and bundle the JS package with Python'
required: false
type: boolean
default: true
artifact-name:
description: 'Name of the artifact to upload'
required: true
type: string
jobs:
build-python-package:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check JS existence
if: ${{ inputs.js }}
id: check_files
uses: andstor/file-existence-action@v3
with:
files: 'plugins/${{ inputs.package }}/src/js/package.json'
- name: Setup Node
id: setup-node
if: ${{ steps.check_files.outputs.files_exists == 'true' }}
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install npm dependencies
if: ${{ steps.setup-node.outcome == 'success'}}
run: npm ci
- name: Build npm packages
if: ${{ steps.setup-node.outcome == 'success'}}
run: npm run build -- --scope "@deephaven/js-plugin-${{ inputs.package }}"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip'
- name: Install build dependencies
run: python -m pip install --upgrade setuptools wheel build
- name: Build wheel
run: python -m build --wheel --sdist plugins/${{ inputs.package }}
- name: Upload dist
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact-name }}
path: plugins/${{ inputs.package }}/dist/
if-no-files-found: error