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
Copy file name to clipboardExpand all lines: .github/workflows/python-publish.yml
+55-5Lines changed: 55 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -6,17 +6,67 @@
6
6
# separate terms of service, privacy policy, and support
7
7
# documentation.
8
8
9
-
name: Publish Package to PyPI
9
+
name: Publish to PyPI
10
10
11
11
on:
12
12
workflow_dispatch:
13
13
release:
14
14
types: [published]
15
15
16
+
permissions:
17
+
contents: read
18
+
16
19
jobs:
17
-
build:
20
+
release-build:
18
21
runs-on: ubuntu-latest
22
+
19
23
steps:
20
-
- uses: actions/checkout@v3
21
-
- name: Build and publish to pypi
22
-
uses: JRubics/poetry-publish@v2.1
24
+
- uses: actions/checkout@v4
25
+
26
+
- uses: actions/setup-python@v5
27
+
with:
28
+
python-version: "3.x"
29
+
30
+
- name: Build release distributions
31
+
run: |
32
+
# NOTE: put your own distribution build steps here.
33
+
python -m pip install build
34
+
python -m build
35
+
poetry build
36
+
37
+
- name: Upload distributions
38
+
uses: actions/upload-artifact@v4
39
+
with:
40
+
name: release-dists
41
+
path: dist/
42
+
43
+
pypi-publish:
44
+
runs-on: ubuntu-latest
45
+
needs:
46
+
- release-build
47
+
permissions:
48
+
# IMPORTANT: this permission is mandatory for trusted publishing
49
+
id-token: write
50
+
51
+
# Dedicated environments with protections for publishing are strongly recommended.
52
+
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
53
+
environment:
54
+
name: pypi
55
+
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
56
+
# url: https://pypi.org/p/YOURPROJECT
57
+
#
58
+
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
59
+
# ALTERNATIVE: exactly, uncomment the following line instead:
0 commit comments