1- name : Publish Python 🐍 distributions 📦 to PyPI
1+ name : Upload Python Package
22
33on :
44 push :
5- branches :
6- - main
7- pull_request :
8- branches :
9- - main
5+ # Sequence of patterns matched against refs/tags
6+ tags :
7+ - ' v*' # Push events to matching v*, i.e. v1.0, v20.15.10
108
119jobs :
12- build-n-publish :
13- name : Build and publish Python 🐍 distributions 📦 to PyPI
10+ release :
11+ name : Create Release
1412 runs-on : ubuntu-18.04
1513 steps :
16- - uses : actions/checkout@master
17-
18- - name : Set up Python 3.7
19- uses : actions/setup-python@v1
14+ - name : Checkout code
15+ uses : actions/checkout@master
16+ - name : Create Release
17+ id : create_release
18+ uses : actions/create-release@v1
19+ env :
20+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
2021 with :
21- python-version : 3.7
22-
23- - name : Install package dependencies
24- run : python -m pip install .[dev]
25-
26- - name : Test with pytest
27- run : python -m pytest
28-
29- - name : Build a binary wheel and a source tarball
30- run : python setup.py sdist bdist_wheel
31-
32- - name : Publish distribution 📦 to PyPI
33- if : startsWith(github.ref, 'refs/tags')
34- uses : pypa/gh-action-pypi-publish@master
35- with :
36- user : __token__
37- password : ${{ secrets.pypi_password }}
22+ tag_name : ${{ github.ref }}
23+ release_name : Release ${{ github.ref }}
24+ body : |
25+ Changes in this Release
26+ draft : false
27+ prerelease : false
28+ deploy :
29+ needs : release
30+ runs-on : ubuntu-latest
31+ steps :
32+ - uses : actions/checkout@v1
33+ - name : Set up Python
34+ uses : actions/setup-python@v1
35+ with :
36+ python-version : ' 3.x'
37+ - name : Install dependencies
38+ run : |
39+ python -m pip install --upgrade pip
40+ pip install setuptools wheel
41+ - name : Build
42+ run : |
43+ python setup.py sdist bdist_wheel
44+ - name : Publish distribution 📦 to PyPI
45+ uses : pypa/gh-action-pypi-publish@master
46+ with :
47+ user : __token__
48+ password : ${{ secrets.pypi_password }}
0 commit comments