Skip to content

Commit

Permalink
Release to testpypi after tests and to pypi on tag (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
stchris authored Jul 1, 2022
1 parent 29e8a9d commit 08f4030
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,35 @@ jobs:
- name: Run tests
run: make test

release:
name: Release
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: "3.10"

- name: Install requirements
run: python -m pip install wheel

- name: Build a distribution
run: python setup.py sdist bdist_wheel

- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@master
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 08f4030

Please sign in to comment.