-
Notifications
You must be signed in to change notification settings - Fork 3
64 lines (52 loc) · 1.7 KB
/
Copy pathrelease.yml
File metadata and controls
64 lines (52 loc) · 1.7 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
name: Publish to PyPI
on:
release:
types: [published]
workflow_dispatch: # allows manual runs from the Actions tab
jobs:
test:
# A release cannot ship with a red suite: the build/publish jobs below
# depend on this passing. Single-platform here for speed; the full
# cross-platform matrix runs on every push via tests.yml.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Sync environment
run: uv sync
working-directory: tsapython
- name: Run test suite
run: uv run pytest -m "not hardware"
working-directory: tsapython
- name: Lint + type check
run: uv run ruff check . && uv run mypy
working-directory: tsapython
build:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Build package
run: uv build tsapython # project lives in the tsapython/ subdirectory
- name: Store distributions
uses: actions/upload-artifact@v4
with:
name: dist
path: tsapython/dist/ # uv writes dist/ inside the project dir
publish:
needs: build
runs-on: ubuntu-latest
environment: pypi # must match the environment in your PyPI publisher config
permissions:
id-token: write # REQUIRED for trusted publishing (OIDC)
steps:
- name: Download distributions
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1