@@ -2,30 +2,50 @@ name: Upload to PyPI
2
2
on :
3
3
release :
4
4
types : [published]
5
+ workflow_dispatch :
6
+ inputs :
7
+ debug_enabled :
8
+ type : boolean
9
+ description : Debug with tmate
10
+ required : false
11
+ default : false
12
+
5
13
jobs :
6
14
upload :
7
15
runs-on : ubuntu-latest
16
+
8
17
steps :
9
- - uses : actions/checkout@v2
10
- - name : Fetch complete history for all tags and branches
11
- run : git fetch --prune --unshallow
12
- - name : Set up Python
13
- uses : actions/setup-python@v2
14
- with :
15
- python-version : ' 3.x'
16
- - name : Install dependencies
17
- run : |
18
- python -m pip install --upgrade pip
19
- pip install setuptools wheel twine setuptools-scm[toml]
20
- - name : Build distribution
21
- run : python setup.py sdist bdist_wheel
22
- - name : Publish to PyPI Test
23
- env :
24
- TWINE_USERNAME : __token__
25
- TWINE_PASSWORD : ${{ secrets.PYPI_TEST_TOKEN }}
26
- run : twine upload --repository testpypi dist/*
27
- - name : Publish to PyPI
28
- env :
29
- TWINE_USERNAME : __token__
30
- TWINE_PASSWORD : ${{ secrets.PYPI_TOKEN }}
31
- run : twine upload --repository pypi dist/*
18
+ - name : Checkout repository
19
+ uses : actions/checkout@v3
20
+
21
+ - name : Fetch all tags and branches
22
+ run : git fetch --prune --unshallow
23
+
24
+ - name : Set up Python
25
+ uses : actions/setup-python@v4
26
+ with :
27
+ python-version : " 3.10"
28
+
29
+ - name : Debug with tmate
30
+ uses : mxschmitt/action-tmate@v3
31
+ if : ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
32
+
33
+ - name : Install dependencies
34
+ run : |
35
+ python -m pip install --upgrade pip
36
+ pip install setuptools wheel twine setuptools-scm[toml]
37
+
38
+ - name : Build distribution
39
+ run : python setup.py sdist bdist_wheel
40
+
41
+ - name : Publish to PyPI Test
42
+ env :
43
+ TWINE_USERNAME : __token__
44
+ TWINE_PASSWORD : ${{ secrets.PYPI_TEST_TOKEN }}
45
+ run : twine upload --repository testpypi dist/*
46
+
47
+ - name : Publish to PyPI
48
+ env :
49
+ TWINE_USERNAME : __token__
50
+ TWINE_PASSWORD : ${{ secrets.PYPI_TOKEN }}
51
+ run : twine upload --repository pypi dist/*
0 commit comments