From 72e81422a650f2b5fa03a9f96f6488813dad0b76 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Klie Date: Thu, 21 Apr 2022 10:37:09 +0200 Subject: [PATCH] No issue - Add publishing action --- .github/workflows/publish_to_pypi.yml | 37 +++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/publish_to_pypi.yml diff --git a/.github/workflows/publish_to_pypi.yml b/.github/workflows/publish_to_pypi.yml new file mode 100644 index 0000000..5170da6 --- /dev/null +++ b/.github/workflows/publish_to_pypi.yml @@ -0,0 +1,37 @@ +name: Publish to PyPi + +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: '3.8' + - name: Install dependencies + run: | + pip install --upgrade -e .[test] + - name: Run tests + run: | + pytest + - name: Build package + run: | + python setup.py sdist + - name: Publish package to TestPyPI + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.test_pypi_password }} + repository_url: https://test.pypi.org/legacy/ + - name: Publish package to PyPI + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.pypi_password }} \ No newline at end of file