File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Publish Python Package
2
+
3
+ on :
4
+ release :
5
+ types : [published]
6
+ workflow_dispatch :
7
+
8
+ jobs :
9
+ # test: ## dont publish without passing test
10
+ publish :
11
+ runs-on : ubuntu-latest
12
+ # needs: [test]
13
+ steps :
14
+ - uses : actions/checkout@v2
15
+ - name : Set up Python
16
+ uses : actions/setup-python@v2
17
+ with :
18
+ python-version : ' 3.9'
19
+ - uses : actions/cache@v2
20
+ name : Configure pip caching
21
+ with :
22
+ path : ~/.cache/pip
23
+ key : ${{ runner.os }}-publish-pip-${{ hashFiles('**/setup.py') }}
24
+ restore-keys : |
25
+ ${{ runner.os }}-publish-pip-
26
+ - name : Build package
27
+ env :
28
+ VERSION : ${{ github.event.release.tag_name }}
29
+ run : |
30
+ pip install setuptools
31
+ python setup.py sdist
32
+ rm dist/*.orig #clean sdist_upip noise
33
+ - name : Publish to Test PyPI
34
+ uses : pypa/gh-action-pypi-publish@release/v1
35
+ with :
36
+ password : ${{ secrets.TEST_PYPI_API_TOKEN }}
37
+ repository_url : https://test.pypi.org/legacy/
38
+ - name : Publish to PyPI
39
+ uses : pypa/gh-action-pypi-publish@release/v1
40
+ if : github.event.release.tag_name
41
+ with :
42
+ password : ${{ secrets.PYPI_API_TOKEN }}
You can’t perform that action at this time.
0 commit comments