-
Notifications
You must be signed in to change notification settings - Fork 42
69 lines (66 loc) · 1.71 KB
/
Copy pathbuild.yml
File metadata and controls
69 lines (66 loc) · 1.71 KB
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
name: Build package
on:
workflow_call:
inputs:
python-version:
required: true
type: string
node-version:
required: true
type: string
jobs:
build-and-validate:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
- uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
- name: Setup dependencies
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
source .venv/bin/activate
uv pip install ".[dev]"
npm i
shell: bash
- name: Build package
run: |
source .venv/bin/activate
npm run build
shell: bash
- name: Generate Python distribution
run: |
source .venv/bin/activate
npm run dist
shell: bash
- name: Build npm package
run: |
source .venv/bin/activate
npm pack
mkdir -p npm-dist
mv *.tgz npm-dist/
shell: bash
- name: Validate distribution
run: |
uv venv test-dist
source test-dist/bin/activate
WHL_FILE=$(ls dist/*.whl)
uv pip install "${WHL_FILE}[dev]"
pytest --headless
shell: bash
- name: Upload Python distributions
uses: actions/upload-artifact@v4
with:
name: python-distributions
path: dist/
- name: Upload npm package
uses: actions/upload-artifact@v4
with:
name: npm-package
path: npm-dist/