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
+
workflow_dispatch:
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
+
- uses: actions/setup-python@v5
21
+
with:
22
+
python-version: "3.x"
23
+
24
+
- name: Build release distributions
25
+
run: |
26
+
python -m pip install build
27
+
python -m build
28
+
29
+
- name: Upload distributions
30
+
uses: actions/upload-artifact@v4
31
+
with:
32
+
name: release-dists
33
+
path: dist/
34
+
35
+
pypi-publish:
36
+
runs-on: ubuntu-latest
37
+
38
+
needs:
39
+
- release-build
40
+
41
+
permissions:
42
+
# IMPORTANT: this permission is mandatory for trusted publishing
43
+
id-token: write
44
+
45
+
# Dedicated environments with protections for publishing are strongly recommended.
0 commit comments