-
Notifications
You must be signed in to change notification settings - Fork 112
73 lines (60 loc) · 1.79 KB
/
pr-wheel-preview-build.yml
File metadata and controls
73 lines (60 loc) · 1.79 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
70
71
72
73
name: PR wheel preview build
on:
pull_request:
branches: [main]
concurrency:
group: pr-wheel-build-${{ github.event.pull_request.number }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions: {}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: trackio/frontend/package-lock.json
- name: Build frontend
run: |
cd trackio/frontend
npm ci
npm run build
- name: Install build
run: python -m pip install build
- name: Build wheel
env:
SKIP_FRONTEND_BUILD: "1"
run: python -m build -w
- name: Write metadata
run: |
python3 << 'PY'
import json
from pathlib import Path
wheels = sorted(Path("dist").glob("trackio-*.whl"))
if len(wheels) != 1:
raise SystemExit(f"expected one trackio wheel, got {[p.name for p in wheels]}")
meta = {
"pr_number": ${{ github.event.pull_request.number }},
"sha": "${{ github.event.pull_request.head.sha }}",
"wheel_basename": wheels[0].name,
}
Path("output.json").write_text(json.dumps(meta))
PY
- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: trackio-wheel
path: dist/*.whl
- name: Upload metadata
uses: actions/upload-artifact@v4
with:
name: pr-wheel-preview-metadata
path: output.json