Skip to content

Commit

Permalink
Distinct TestPyPI and PyPI deploy jobs (#5)
Browse files Browse the repository at this point in the history
Failure on TestPyPI impacted the run of the PyPI job.
  • Loading branch information
inetAnt authored Jul 5, 2021
1 parent aca9cdd commit 37ef8c2
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ jobs:

# https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
build-publish:
name: Build and publish Python distributions to TestPyPI and PyPI
name: Publish Python distributions to TestPyPI
runs-on: ubuntu-latest
needs: run-tests # only run when tests where successful
continue-on-error: true
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')
if: github.ref == 'refs/heads/master'

steps:
- uses: actions/checkout@v2
Expand All @@ -49,13 +48,31 @@ jobs:
- name: Build a binary wheel and a source tarball
run: |
python -m build --sdist --wheel --outdir dist/ .
- name: Publish distribution 📦 to Test PyPI
- name: Publish distribution to TestPyPI
uses: pypa/[email protected]
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')

build-publish-tags:
name: Publish Python distributions to PyPI
runs-on: ubuntu-latest
needs: run-tests # only run when tests where successful
if: startsWith(github.ref, 'refs/tags')

steps:
- uses: actions/checkout@v2
- name: Setup Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install pypa/build
run: |
python -m pip install build --user
- name: Build a binary wheel and a source tarball
run: |
python -m build --sdist --wheel --outdir dist/ .
- name: Publish distribution to PyPI
uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 37ef8c2

Please sign in to comment.