Skip to content

Commit 7572b90

Browse files
authored
CD automation for deployment to PyPI (#35)
1 parent 9c97572 commit 7572b90

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

.github/workflows/cd.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This workflows 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: CD
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+
18+
- name: Set up Python 3.10
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: '3.10'
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install setuptools wheel twine
27+
28+
## Prod PyPI
29+
- name: Build and publish
30+
env:
31+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
32+
TWINE_PASSWORD: ${{ secrets.PYPI_PROD_PASSWORD }}
33+
run: |
34+
python setup.py sdist bdist_wheel
35+
twine upload dist/*
36+
37+
## Test PyPI
38+
# - name: Build and publish
39+
# env:
40+
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
41+
# TWINE_PASSWORD: ${{ secrets.PYPI_TEST_PASSWORD }}
42+
# run: |
43+
# python setup.py sdist bdist_wheel
44+
# twine upload --repository testpypi dist/*
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env python2
22

3-
__version__ = '0.3'
3+
__version__ = '0.4'

0 commit comments

Comments
 (0)