@@ -31,11 +31,10 @@ jobs:
3131
3232# https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
3333 build-publish :
34- name : Build and publish Python distributions to TestPyPI and PyPI
34+ name : Publish Python distributions to TestPyPI
3535 runs-on : ubuntu-latest
3636 needs : run-tests # only run when tests where successful
37- continue-on-error : true
38- if : github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')
37+ if : github.ref == 'refs/heads/master'
3938
4039 steps :
4140 - uses : actions/checkout@v2
@@ -49,13 +48,31 @@ jobs:
4948 - name : Build a binary wheel and a source tarball
5049 run : |
5150 python -m build --sdist --wheel --outdir dist/ .
52- - name : Publish distribution 📦 to Test PyPI
51+ - name : Publish distribution to TestPyPI
5352 uses : pypa/gh-action-pypi-publish@v1.4.2
5453 with :
5554 password : ${{ secrets.TEST_PYPI_API_TOKEN }}
5655 repository_url : https://test.pypi.org/legacy/
57- - name : Publish distribution 📦 to PyPI
58- if : startsWith(github.ref, 'refs/tags')
56+
57+ build-publish-tags :
58+ name : Publish Python distributions to PyPI
59+ runs-on : ubuntu-latest
60+ needs : run-tests # only run when tests where successful
61+ if : startsWith(github.ref, 'refs/tags')
62+
63+ steps :
64+ - uses : actions/checkout@v2
65+ - name : Setup Python 3.9
66+ uses : actions/setup-python@v2
67+ with :
68+ python-version : 3.9
69+ - name : Install pypa/build
70+ run : |
71+ python -m pip install build --user
72+ - name : Build a binary wheel and a source tarball
73+ run : |
74+ python -m build --sdist --wheel --outdir dist/ .
75+ - name : Publish distribution to PyPI
5976 uses : pypa/gh-action-pypi-publish@v1.4.2
6077 with :
6178 password : ${{ secrets.PYPI_API_TOKEN }}
0 commit comments