diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..24ab456 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,31 @@ +name: Build and publish to PyPi + +on: + release: + types: [published] + +jobs: + # Push a new release to PyPI + deploy_to_pypi: + name: Publish to PyPI + runs-on: ubuntu-latest + if: github.actor != 'mindsdbadmin' + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5.1.0 + with: + python-version: ${{ vars.CI_PYTHON_VERSION }} + - name: Install dependencies + run: | + pip install . + pip install setuptools wheel twine build + - name: Clean previous builds + run: rm -rf dist/ build/ *.egg-info + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python -m build + twine upload dist/* diff --git a/pyproject.toml b/pyproject.toml index 4526f4d..c3e5331 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,8 +25,11 @@ dependencies = [ ] dynamic = ["version"] +[tool.setuptools.dynamic] +version = {attr = "aipdf.__version__"} + [project.urls] -Homepage = "https://github.com/yourusername/aipdf" -Repository = "https://github.com/yourusername/aipdf.git" +Homepage = "https://github.com/mindsdb/aipdf" +Repository = "https://github.com/mindsdb/aipdf.git" [tool.setuptools_scm] \ No newline at end of file diff --git a/src/aipdf/__init__.py b/src/aipdf/__init__.py index da5e034..5cb869e 100644 --- a/src/aipdf/__init__.py +++ b/src/aipdf/__init__.py @@ -1 +1,5 @@ -from .ocr import ocr \ No newline at end of file +from .ocr import ocr + +__version__ = "0.0.1" + +__all__ = ["__version__", "ocr"]