From 7a75071ef8cf0444a6ae54c2e7fae031f3f6332a Mon Sep 17 00:00:00 2001 From: Samuel Garcia Date: Tue, 8 Mar 2022 16:48:49 +0100 Subject: [PATCH] auto push to pypi on push tags --- .github/workflows/publish-to-pypi.yml | 34 +++++++++++++++++++++++++++ 1 file changed, 34 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 000000000..6ec354ed2 --- /dev/null +++ b/.github/workflows/publish-to-pypi.yml @@ -0,0 +1,34 @@ +name: Release to PyPI + +on: + push: + tags: + - '*' + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Install dependencies for testing + run: | + pip install pytest pytest-cov + pip install setuptools wheel twine + pip install -r requirements.txt + pip install -e . + - name: Test core with pytest + run: | + pytest --cov=neo neo/test/coretest + - name: Publish on PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/*