You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# This workflow will upload a Python Package to PyPI when a release is created
2
+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
+
4
+
name: Upload Python Package
5
+
6
+
on:
7
+
release:
8
+
types: [published]
9
+
10
+
permissions:
11
+
contents: read
12
+
13
+
jobs:
14
+
release-build:
15
+
runs-on: ubuntu-latest
16
+
17
+
steps:
18
+
- uses: actions/checkout@v4
19
+
20
+
- name: Install uv
21
+
uses: astral-sh/setup-uv@v4
22
+
with:
23
+
enable-cache: true
24
+
cache-dependency-glob: "uv.lock"
25
+
26
+
- name: Set up Python
27
+
uses: actions/setup-python@v5
28
+
with:
29
+
python-version-file: "pyproject.toml"
30
+
31
+
- name: Build release distributions
32
+
run: uv build
33
+
34
+
- name: Upload distributions
35
+
uses: actions/upload-artifact@v4
36
+
with:
37
+
name: release-dists
38
+
path: dist/
39
+
40
+
pypi-publish:
41
+
runs-on: ubuntu-latest
42
+
needs:
43
+
- release-build
44
+
permissions:
45
+
# IMPORTANT: this permission is mandatory for trusted publishing
46
+
id-token: write
47
+
48
+
# Dedicated environments with protections for publishing are strongly recommended.
0 commit comments