diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 800d429..ad14c99 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,14 @@ name: build -on: [push] +on: + push: + branches: + - master + - rb-* + tags: + - v* + + pull_request: jobs: build: @@ -28,4 +36,30 @@ jobs: - name: Upload codecov uses: codecov/codecov-action@v3 with: + token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: true + + deploy: + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'ESSS/flask-restalchemy' + + runs-on: ubuntu-20.04 + + needs: build + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.6" + + - name: Build Package + run: | + python -m pip install --upgrade pip wheel setuptools + python setup.py sdist bdist_wheel + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.pypi_token }} diff --git a/setup.cfg b/setup.cfg index ee91939..6879d17 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,7 @@ +[metadata] +long_description = file: README.md +long_description_content_type= text/markdown + [bdist_wheel] python_tag = py3