From b973e309df54cb627ac73d0b62f38822328a4ed2 Mon Sep 17 00:00:00 2001 From: pavi Date: Sun, 21 Jul 2024 12:04:52 +0530 Subject: [PATCH] . --- setup.py | 86 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 50 insertions(+), 36 deletions(-) diff --git a/setup.py b/setup.py index 8b4721f..b784da9 100644 --- a/setup.py +++ b/setup.py @@ -1,36 +1,50 @@ -from setuptools import find_packages -from setuptools import setup - -def get_long_description(): - with open("README.md", "r", encoding="utf-8") as f: - return f.read() - -setup( - name="geminikit", - version="1.0.2", - author="paviththanan", - author_email="rkpavi06@gmail.com", - description="The python package that returns Response of Google Gemini through Cookies.", - long_description=get_long_description(), - long_description_content_type="text/markdown", - url="https://github.com/rekcah-pavi/geminikit", - packages=find_packages(exclude=[]), - python_requires=">=3.6", - install_requires=[ - "httpx", - ], - keywords="Python, API, Gemini, Google Gemini, Large Language Model, Chatbot API, Google API, Chatbot", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Science/Research", - "Natural Language :: English", - "Programming Language :: Python", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "License :: OSI Approved :: MIT License", - "Topic :: Scientific/Engineering :: Artificial Intelligence", - ], -) +name: Publish Python Package + +on: + push: + branches: + - main + +jobs: + build-and-publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Check if setup.py is modified + id: check_setup + run: | + if git diff --name-only HEAD^ HEAD | grep -q "setup.py"; then + echo "setup.py changed" + echo "changed=true" >> $GITHUB_ENV + else + echo "setup.py not changed" + echo "changed=false" >> $GITHUB_ENV + fi + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.11' + if: env.changed == 'true' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + if: env.changed == 'true' + + - name: Build package + run: | + python setup.py sdist bdist_wheel + if: env.changed == 'true' + + - name: Publish package + env: + TWINE_USERNAME: _token_ + TWINE_PASSWORD: ${{ secrets.token }} + run: | + twine upload dist/* + if: env.changed == 'true'