From 990f87ed4074d36e92bf8e56c5ad4b0997d621af Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 3 May 2021 22:57:25 +0300 Subject: workflows/test: add a job to publish to PyPI --- .github/workflows/test.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6d7b055..4936d8b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,3 +38,31 @@ jobs: - name: Run the tests run: ./.ci/bin/main.sh + + publish_pypi: + needs: [test] + runs-on: ubuntu-18.04 + name: Publish + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3 + - name: Install tools + run: python3 -m pip install --upgrade build + - name: Build package + run: python3 -m build + - name: Upload dist + uses: actions/upload-artifact@v2 + with: + name: dist + path: dist + if-no-files-found: error + - name: Publish package + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: '${{ secrets.PYPI_API_TOKEN }}' -- cgit v1.2.3