File tree Expand file tree Collapse file tree 3 files changed +16
-11
lines changed
Expand file tree Collapse file tree 3 files changed +16
-11
lines changed Original file line number Diff line number Diff line change 1- name : " Build and publish python sdist"
1+ name : " Build and publish Python sdist"
22
33on :
4- push :
5- branches : main
64 workflow_dispatch :
75 inputs :
86 target :
97 description : ' Deployment target. Can be "pypi" or "testpypi"'
108 default : ' pypi'
9+ workflow_run :
10+ workflows : ["Build and publish Python wheels"]
11+ types : [completed]
1112
1213jobs :
1314 build_sdist :
1617 strategy :
1718 matrix :
1819 python-version : [3.8]
19-
20+ if : |
21+ ${{ github.event.workflow_run.conclusion == 'success' }} ||
22+ github.event_name == 'workflow_dispatch'
2023 steps :
2124 - uses : actions/checkout@v2
2225
@@ -29,15 +32,13 @@ jobs:
2932 run : pip install wheel
3033
3134 - name : Build sdist
32- run : python setup.py sdist --formats=gztar,zip
35+ run : python setup.py sdist --formats=gztar
3336
3437 - name : Upload sdist
3538 uses : actions/upload-artifact@v2
3639 with :
3740 name : files
38- path : |
39- ./dist/*.tar.gz
40- ./dist/*.zip
41+ path : ./dist/*.tar.gz
4142 if-no-files-found : error
4243
4344
5354 path : sdist
5455
5556 - name : Publish sdist on PyPI
56- if : github.event.inputs.target == 'pypi'
57+ if : |
58+ github.event.inputs.target == 'pypi' ||
59+ (github.event_name == 'push' && github.ref == 'refs/heads/main')
5760 uses : pypa/gh-action-pypi-publish@master
5861 with :
5962 user : __token__
Original file line number Diff line number Diff line change 8181 name : wheels
8282
8383 - name : Publish wheels on PyPI
84- if : github.event.inputs.target == 'pypi'
84+ if : |
85+ github.event.inputs.target == 'pypi' ||
86+ (github.event_name == 'push' && github.ref == 'refs/heads/main')
8587 uses : pypa/gh-action-pypi-publish@master
8688 with :
8789 user : __token__
Original file line number Diff line number Diff line change 11{
22 "default-registry" : {
33 "kind" : " builtin" ,
4- "baseline" : " 642d1ccb276ce13d8a8521b1ef2856f5f7bc9cdd "
4+ "baseline" : " e201002b4f4827d7b7b672f0c5c672a77fc3b77d "
55 },
66 "registries" : [
77 {
You can’t perform that action at this time.
0 commit comments