From e90ef79e4965ccc5f4608d08eeb460a911336c49 Mon Sep 17 00:00:00 2001 From: Frank Milthaler Date: Sat, 15 Jul 2023 13:27:06 +0200 Subject: [PATCH] Chore/pypi cd (#98) Adding CD pipeline to push new releases to pypi --- .github/workflows/pypi-publish.yml | 34 ++++++++++++++++++++++++++++++ requirements_cd.txt | 4 ++++ setup.py | 1 + 3 files changed, 39 insertions(+) create mode 100644 .github/workflows/pypi-publish.yml create mode 100644 requirements_cd.txt diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml new file mode 100644 index 00000000..8da949f9 --- /dev/null +++ b/.github/workflows/pypi-publish.yml @@ -0,0 +1,34 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Python CD - Publish on PyPI + +on: + release: + types: [published] + +jobs: + deploy: + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/finquant + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install .[cd] + - name: Build package + run: python setup.py sdist bdist_wheel + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_FINQUANT_API_TOKEN }} \ No newline at end of file diff --git a/requirements_cd.txt b/requirements_cd.txt new file mode 100644 index 00000000..9ed75bf2 --- /dev/null +++ b/requirements_cd.txt @@ -0,0 +1,4 @@ +build +setuptools +wheel +twine \ No newline at end of file diff --git a/setup.py b/setup.py index 6588f35f..7cf398bd 100644 --- a/setup.py +++ b/setup.py @@ -19,6 +19,7 @@ def read_requirements(file_path): "test": read_requirements("requirements_test.txt"), "dev": read_requirements("requirements_dev.txt"), "docs": read_requirements("requirements_docs.txt"), + "cd": read_requirements("requirements_cd.txt"), } setuptools.setup(