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
# Based on template at https://docs.github.com/en/enterprise-cloud@latest/actions/use-cases-and-examples/building-and-testing/building-and-testing-python?learn=continuous_integration#publishing-to-pypi
2
+
3
+
name: Publish to PyPI
4
+
5
+
on:
6
+
release:
7
+
types: [published]
8
+
9
+
permissions:
10
+
contents: read
11
+
12
+
jobs:
13
+
release-build:
14
+
runs-on: ubuntu-latest
15
+
16
+
steps:
17
+
- uses: actions/checkout@v4
18
+
19
+
- uses: actions/setup-python@v5
20
+
with:
21
+
python-version: "3.x"
22
+
23
+
- name: Build release distributions
24
+
run: |
25
+
python -m pip install build
26
+
python -m build
27
+
28
+
- name: Upload distributions
29
+
uses: actions/upload-artifact@v4
30
+
with:
31
+
name: release-dists
32
+
path: dist/
33
+
34
+
pypi-publish:
35
+
runs-on: ubuntu-latest
36
+
37
+
needs:
38
+
- release-build
39
+
40
+
permissions:
41
+
# IMPORTANT: this permission is mandatory for trusted publishing
42
+
id-token: write
43
+
44
+
# Dedicated environments with protections for publishing are strongly recommended.
0 commit comments