From 2f3797cfcf2981bc1f2c3e55767149d59206972f Mon Sep 17 00:00:00 2001 From: Salad Dais Date: Sat, 1 May 2021 21:18:14 +0000 Subject: [PATCH] Add test PyPI publishing workflow --- .github/workflows/pypi_publish.yml | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/pypi_publish.yml diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml new file mode 100644 index 0000000..1d67d7c --- /dev/null +++ b/.github/workflows/pypi_publish.yml @@ -0,0 +1,36 @@ +name: PyPi Release + +# https://help.github.com/en/actions/reference/events-that-trigger-workflows +on: + # Only trigger on release creation + release: + types: + - created + +# based on https://github.com/pypa/gh-action-pypi-publish + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools wheel + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Build + run: >- + python setup.py sdist bdist_wheel + # We do this, since failures on test.pypi aren't that bad + - name: Publish to Test PyPI + if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' + uses: pypa/gh-action-pypi-publish@v1 + with: + user: __token__ + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/