File tree 1 file changed +33
-9
lines changed
1 file changed +33
-9
lines changed Original file line number Diff line number Diff line change 23
23
- name : Upload source distribution
24
24
uses : actions/upload-artifact@v3
25
25
with :
26
- name : sdist
27
- path : " dist/*.tar.gz"
28
- if-no-files-found : error
29
- - name : Upload wheel
30
- uses : actions/upload-artifact@v3
31
- with :
32
- name : wheel
33
- path : " dist/*.whl"
26
+ name : build-output
27
+ path : " dist/*"
34
28
if-no-files-found : error
35
29
36
30
test :
74
68
- name : Download wheel
75
69
uses : actions/download-artifact@v3
76
70
with :
77
- name : wheel
71
+ name : build-output
78
72
path : dist/
79
73
80
74
- name : Install wheel
85
79
- name : Test with pytest
86
80
run : |
87
81
pytest
82
+
83
+ deploy :
84
+ runs-on : ubuntu-latest
85
+ needs : [build, test]
86
+
87
+ steps :
88
+ - name : Download artifacts
89
+ uses : actions/download-artifact@v3
90
+ with :
91
+ name : build-output
92
+ path : dist/
93
+
94
+ - name : Deploy to Test PyPI
95
+ uses : pypa/gh-action-pypi-publish@release/v1
96
+ if : startsWith(github.ref, 'refs/head/master')
97
+ with :
98
+ password : ${{ secrets.TEST_PYPI_API_TOKEN }}
99
+ repository_url : https://test.pypi.org/legacy/
100
+
101
+ - name : Release
102
+ uses : softprops/action-gh-release@v1
103
+ if : startsWith(github.ref, 'refs/tags/v')
104
+ with :
105
+ files : dist/*
106
+
107
+ - name : Deploy to PyPI
108
+ uses : pypa/gh-action-pypi-publish@release/v1
109
+ if : startsWith(github.ref, 'refs/tags/v')
110
+ with :
111
+ password : ${{ secrets.PYPI_API_TOKEN }}
You can’t perform that action at this time.
0 commit comments