diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml new file mode 100644 index 0000000..ed4af27 --- /dev/null +++ b/.github/workflows/pypi-release.yml @@ -0,0 +1,33 @@ +name: Publish package to PyPi + +on: + release: + types: [published] + +jobs: + + push: + runs-on: ubuntu-20.04 + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: setup python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install pip + run: pip install pip + + - name: Install Dependencies + run: pip install setuptools wheel + + - name: Build package + run: python setup.py sdist bdist_wheel + + - name: Publish to PyPi + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.PYPI_UPLOAD_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 16cd01f..2beb88f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,9 @@ .DS_STORE *.swp + +# Packages +*.egg +*.egg-info +dist +build +eggs \ No newline at end of file diff --git a/setup.py b/setup.py index a1f287b..e14bf6a 100644 --- a/setup.py +++ b/setup.py @@ -46,8 +46,6 @@ def is_requirement(line): return line and not line.startswith(('-r', '#', '-e', 'git+', '-c')) -VERSION = get_version('warnings_report', '__init__.py') - if sys.argv[-1] == 'tag': print("Tagging the version on github:") os.system(u"git tag -a %s -m 'version %s'" % (VERSION, VERSION)) @@ -68,7 +66,7 @@ def is_requirement(line): license='AGPL', url='https://github.com/edx/pytest-warnings-report', description='A pytest plugin for generating warnings reports.', - long_description=read('README.rst'), + long_description=README, py_modules=['pytest_warnings_report'], python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', include_package_data=True,