Skip to content

Commit dc3cef7

Browse files
authored
Create python-publish.yml
1 parent e2a6857 commit dc3cef7

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
name: Upload Python Package to PyPI
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
deploy:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Python
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: '3.x'
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
python -m pip install pytest pytest-cov
25+
python -m pip install setuptools wheel twine
26+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
27+
- name: Tests with pytest
28+
run: |
29+
python3 -m pytest --cov=fastapi_featureflags -v tests/ --disable-warnings
30+
- name: Build and publish
31+
env:
32+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
33+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
34+
run: |
35+
python setup.py sdist bdist_wheel
36+
twine upload dist/*

0 commit comments

Comments
 (0)