Skip to content

Commit 4bc6f21

Browse files
author
Inbal Tako
committed
Add publish on release
1 parent 4fe1cfa commit 4bc6f21

File tree

2 files changed

+26
-12
lines changed

2 files changed

+26
-12
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99

1010
jobs:
1111
ci:
12-
1312
runs-on: ubuntu-latest
1413
steps:
1514
- name: Notify slack success
@@ -25,17 +24,6 @@ jobs:
2524

2625
- name: Run Tests
2726
uses: onichandame/python-test-action@master
28-
run: python -m unittest
29-
30-
- name: Build dist
31-
uses: actions/setup-python@v2
32-
run: python setup.py sdist bdist_wheel
33-
34-
- name: Publish a Python distribution to PyPI
35-
uses: pypa/gh-action-pypi-publish@master
36-
with:
37-
user: ${{ secrets.PYPI_USER }}
38-
password: ${{ secrets.PYPI_PASSWORD }}
3927

4028
- name: Notify slack success
4129
if: success()

.github/workflows/publish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Upload Python Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set up Python
13+
uses: actions/setup-python@v2
14+
with:
15+
python-version: '3.x'
16+
- name: Install dependencies
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install setuptools wheel twine
20+
- name: Build and publish
21+
env:
22+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
23+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
24+
run: |
25+
python setup.py sdist bdist_wheel
26+
twine upload dist/*

0 commit comments

Comments
 (0)