Skip to content

Commit

Permalink
Automatic release to PyPi on Github Release
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrugman authored and tomcis committed Jun 10, 2020
1 parent 2d4f6d6 commit ae735b1
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/pypi.yml
@@ -0,0 +1,45 @@
name: Deploy to PyPi

on:
release:
types: [created]

jobs:
release:
if: github.event_name == 'release' && github.event.action == 'created'
name: PyPi Release
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
name: Checkout repo

- name: Set up Python 3.6
uses: actions/setup-python@v1
with:
python-version: 3.6

- uses: actions/cache@v1
name: Cache pip dependencies
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install pip dependencies
run: |
pip install --upgrade pip
pip install -r requirements.txt
- name: Install
run: make install

- name: Make distribution
run: |
pip install twine
python setup.py sdist bdist_wheel
twine check dist/*
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}

0 comments on commit ae735b1

Please sign in to comment.