-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (33 loc) · 975 Bytes
/
publish.yml
File metadata and controls
41 lines (33 loc) · 975 Bytes
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
name: Publish to PyPI
on:
release:
types: [published]
workflow_dispatch: # Enable manual trigger.
jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
id-token: write # Mandatory for OIDC.
contents: read
steps:
- name: Checkout (official GitHub action)
uses: actions/checkout@v4
with:
# Important for versioning plugins:
fetch-depth: 0
- name: Install uv (official Astral action)
uses: astral-sh/setup-uv@v5
with:
version: "0.7.11"
enable-cache: true
python-version: "3.12"
- name: Set up Python (using uv)
run: uv python install
- name: Install all dependencies
run: uv sync --extra cpu --group dev
- name: Run tests
run: uv run pytest
- name: Build package
run: uv build
- name: Publish to PyPI (using uv)
uses: pypa/gh-action-pypi-publish@release/v1