Skip to content

Commit

Permalink
Run GitHub actions publish job after successful test and docs job
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasberbuer committed May 25, 2021
1 parent d86623b commit 1ad8634
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 29 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -46,3 +46,28 @@ jobs:
run: pip install tox
- name: Check docs
run: tox -e docs

publish:
needs: [test, docs] # only run if previous jobs are successful
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install pypa/build
run: python -m pip install build --user
- name: Build a source tarball
run: python -m build --sdist --outdir dist/ .
- name: Publish package to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
- name: Publish package to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
29 changes: 0 additions & 29 deletions .github/workflows/publish.yml

This file was deleted.

0 comments on commit 1ad8634

Please sign in to comment.