-
Notifications
You must be signed in to change notification settings - Fork 2
94 lines (81 loc) · 2.35 KB
/
release.yml
File metadata and controls
94 lines (81 loc) · 2.35 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Release
on:
push:
tags:
- "v*" # Publish on any tag starting with v, e.g., v0.1.0
workflow_dispatch:
jobs:
build:
name: Build distributions
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0 # Required for hatch-vcs
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
# Build frontend
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Build frontend
run: |
cd frontend
npm ci
npm run build
rm -rf ../src/hyperview/server/static
mkdir -p ../src/hyperview/server/static
cp -r out/* ../src/hyperview/server/static/
# Build Python package (includes frontend assets)
- name: Build
run: uv build --no-sources
# Smoke test: verify the built package can be imported
- name: Smoke test (wheel)
run: |
uv run --isolated --no-project --with dist/*.whl \
python -c "import hyperview; print(f'hyperview {hyperview.__version__}')"
- name: Smoke test (sdist)
run: |
uv run --isolated --no-project --with dist/*.tar.gz \
python -c "import hyperview; print(f'hyperview {hyperview.__version__}')"
- name: Upload dist artifacts
uses: actions/upload-artifact@v5
with:
name: python-package-distributions
path: dist/
if-no-files-found: error
pypi:
name: Publish to PyPI
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/hyperview
permissions:
id-token: write
contents: read
steps:
- name: Download dist artifacts
uses: actions/download-artifact@v6
with:
name: python-package-distributions
path: dist/
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Publish to PyPI
run: uv publish