File tree 1 file changed +45
-0
lines changed
1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Build & maybe upload PyPI package
2
+
3
+ on :
4
+ push :
5
+ pull_request :
6
+ release :
7
+ types :
8
+ - published
9
+ workflow_dispatch :
10
+
11
+ permissions :
12
+ contents : read
13
+
14
+ jobs :
15
+ # Always build & lint package.
16
+ build-package :
17
+ name : Build & verify package
18
+ runs-on : ubuntu-latest
19
+
20
+ steps :
21
+ - uses : actions/checkout@v3
22
+
23
+ - uses : hynek/build-and-inspect-python-package@v1
24
+
25
+ # Upload to real PyPI on GitHub Releases.
26
+ release-pypi :
27
+ name : Publish to PyPI
28
+ environment : release-pypi
29
+ # Only run for published releases.
30
+ if : github.repository_owner == 'python' && github.event.action == 'published'
31
+ runs-on : ubuntu-latest
32
+ needs : build-package
33
+
34
+ permissions :
35
+ id-token : write
36
+
37
+ steps :
38
+ - name : Download packages built by build-and-inspect-python-package
39
+ uses : actions/download-artifact@v3
40
+ with :
41
+ name : Packages
42
+ path : dist
43
+
44
+ - name : Upload package to PyPI
45
+ uses : pypa/gh-action-pypi-publish@release/v1
You can’t perform that action at this time.
0 commit comments