diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 6b68bf1..d0c6c3f 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -7,6 +7,8 @@ on: pull_request: branches: - main # Change this to the default branch of your repository + release: + types: [published] jobs: lint: @@ -154,3 +156,30 @@ jobs: with: name: dist path: dist/*.tar.gz + + deploy: + needs: build_django_32 + runs-on: ubuntu-latest + if: github.event_name == 'release' && github.event.action == 'published' + environment: release + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.x' + - name: Install Pipenv + run: python -m pip install --upgrade pipenv + - name: Install dependencies with Pipenv + run: | + pipenv install --dev + - name: Build package + run: pipenv run python -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@v1.8.10 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + packages_dir: dist/ diff --git a/setup.py b/setup.py index fecb91b..773deaf 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ long_description=long_description, long_description_content_type='text/markdown', url='http://github.com/pescheckit/django-country-kit', - packages=find_packages(), + packages=["django_country_kit"], include_package_data=True, install_requires=[ 'Django>=3.0',