Skip to content

Commit f22fdbb

Browse files
author
brentru
committed
add release workflow
1 parent a134411 commit f22fdbb

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release CI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
upload-pypi:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v1
12+
- name: Check For setup.py
13+
id: need-pypi
14+
run: |
15+
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
16+
- name: Set up Python
17+
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
18+
uses: actions/setup-python@v1
19+
with:
20+
python-version: '3.x'
21+
- name: Install dependencies
22+
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install setuptools wheel twine
26+
- name: Build and publish
27+
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
28+
env:
29+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
30+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
31+
run: |
32+
python setup.py sdist
33+
twine upload dist/*

0 commit comments

Comments
 (0)