-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (61 loc) · 2.06 KB
/
Copy pathrelease.yml
File metadata and controls
71 lines (61 loc) · 2.06 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
name: Release
# Build the wheel + sdist (GUI bundled), smoke-test the install, and publish to
# PyPI on a version tag. `workflow_dispatch` runs the build + smoke test only
# (no publish) so the pipeline can be exercised before a real release.
#
# Publishing uses PyPI Trusted Publishing (OIDC) — no API token. See
# docs/RELEASING.md for the one-time publisher setup.
on:
push:
tags: ["v*"]
workflow_dispatch: {}
jobs:
build:
name: Build + smoke test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
cache-dependency-path: gui/web/package-lock.json
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Check tag matches project version
if: startsWith(github.ref, 'refs/tags/v')
run: |
ver="$(uv version --short)"
if [ "v$ver" != "$GITHUB_REF_NAME" ]; then
echo "::error::tag $GITHUB_REF_NAME does not match project version v$ver"
exit 1
fi
# Build GUI → stage → sdist+wheel → verify bundle → smoke-test the wheel.
# Same script developers run locally, so the two can't drift.
- name: Build + smoke test the distribution
run: scripts/build-dist.sh --smoke
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
publish:
name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/v')
needs: build
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write # trusted publishing (OIDC)
contents: write # create the GitHub Release
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: gh release create "$GITHUB_REF_NAME" dist/* --repo "$GITHUB_REPOSITORY" --generate-notes