diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..3cf7200 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,28 @@ +on: [push, pull_request] + +jobs: + publish: + name: build and publish to pypi + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: install dependencies & build + run: | + pip3 install setuptools wheel + python3 setup.py sdist bdist_wheel + + - name: publish to Test PyPi + uses: pypa/gh-action-pypi-publish@release/v1 + with: + skip_existing: true + user: __token__ + password: ${{ secrets.TEST_PYPI_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + + - name: publish to PyPi + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_TOKEN }} \ No newline at end of file diff --git a/setup.py b/setup.py index fbb49a1..09afb73 100644 --- a/setup.py +++ b/setup.py @@ -1,14 +1,8 @@ import os -from distutils.core import setup - -about = {} -here = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(here,'gwh', '__version__.py'), encoding='utf-8') as f: - exec(f.read(), about) +from setuptools import setup setup( - name=about['__title__'], - version=about['__version__'], + name="gwh", author='Andy Hebrank', author_email='ahebrank@gmail.com', packages=['gwh'], @@ -16,6 +10,7 @@ description='Webhook Handler for GitLab', license='Apache License, Version 2.0', long_description=open('README.md', encoding='utf-8').read(), + long_description_content_type='text/markdown', install_requires=[ 'Flask>=1.0', 'requests>=2.19.0'