Skip to content

Commit

Permalink
Add automatization of pypi release
Browse files Browse the repository at this point in the history
  • Loading branch information
kubantjan committed Feb 8, 2021
1 parent d255de6 commit d14af86
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release to PyPI

on:
release:
types: [released]

jobs:
release:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Tools
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Package and Upload
env:
VERSION: ${{ github.event.release.tag_name }}
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_APIKEY }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""

# To use a consistent encoding
import os
from codecs import open
from os import path

Expand All @@ -15,7 +16,7 @@

here = path.abspath(path.dirname(__file__))

VERSION = '0.3.0'
VERSION = os.getenv('VERSION')

# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
Expand Down

0 comments on commit d14af86

Please sign in to comment.