Skip to content

Commit 0162d3c

Browse files
committed
Added new workflow to publish the Python package to PyPi upon release.
1 parent c5a41d4 commit 0162d3c

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/pypi_publish.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This workflows will upload a Python Package using Twine when a release is created.
2+
3+
name: Upload the Plato Python Package to PyPI
4+
5+
on:
6+
release:
7+
types: [created]
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up Python
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: "3.x"
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install --upgrade setuptools wheel twine
23+
- name: Build and publish
24+
env:
25+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
26+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
27+
run: |
28+
rm -rf dist/
29+
pip wheel . -w dist
30+
twine upload --repository testpypi dist/plato_learn*
31+
twine upload --repository pypi dist/plato_learn*

0 commit comments

Comments
 (0)