Skip to content

Commit e90ef79

Browse files
authored
Chore/pypi cd (#98)
Adding CD pipeline to push new releases to pypi
1 parent aaf6b32 commit e90ef79

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

.github/workflows/pypi-publish.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
name: Python CD - Publish on PyPI
7+
8+
on:
9+
release:
10+
types: [published]
11+
12+
jobs:
13+
deploy:
14+
runs-on: ubuntu-latest
15+
environment:
16+
name: pypi
17+
url: https://pypi.org/p/finquant
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Set up Python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: '3.10'
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
python -m pip install .[cd]
28+
- name: Build package
29+
run: python setup.py sdist bdist_wheel
30+
- name: Publish package to PyPI
31+
uses: pypa/gh-action-pypi-publish@release/v1
32+
with:
33+
user: __token__
34+
password: ${{ secrets.PYPI_FINQUANT_API_TOKEN }}

requirements_cd.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build
2+
setuptools
3+
wheel
4+
twine

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def read_requirements(file_path):
1919
"test": read_requirements("requirements_test.txt"),
2020
"dev": read_requirements("requirements_dev.txt"),
2121
"docs": read_requirements("requirements_docs.txt"),
22+
"cd": read_requirements("requirements_cd.txt"),
2223
}
2324

2425
setuptools.setup(

0 commit comments

Comments
 (0)