diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 0000000..dd511ae --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,13 @@ +[bumpversion] +current_version = 0.0.1 +commit = True +tag = True + +[bumpversion:file:pyproject.toml] +search = version = "{current_version}" +replace = version = "{new_version}" + +[bumpversion:file:src/DraftGPT/__init__.py] +search = __version__ = "{current_version}" +replace = __version__ = "{new_version}" + diff --git a/.github/workflows/build-project.yml b/.github/workflows/build-project.yml index cf59d66..9efafca 100644 --- a/.github/workflows/build-project.yml +++ b/.github/workflows/build-project.yml @@ -1,8 +1,9 @@ -name: Build DraftGPT Package +name: Build and Publish DraftGPT Package on: workflow_dispatch: + jobs: build: runs-on: ubuntu-latest @@ -10,6 +11,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Set up Python uses: actions/setup-python@v4 @@ -19,7 +22,14 @@ jobs: - name: Install build dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel + pip install setuptools wheel twine bump2version + + - name: Bump version + id: bump_version + run: | + bump2version patch + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Build package run: | @@ -29,9 +39,20 @@ jobs: - name: Verify build run: | ls dist/ - - - name: Upload build artifacts - uses: actions/upload-artifact@v3 + + - name: Publish to PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: twine upload dist/* + + - name: Create GitHub release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - name: drafgpt-package - path: dist/ + tag_name: v${{ steps.bump_version.outputs.new_version }} + release_name: Release ${{ steps.bump_version.outputs.new_version }} + body: | + Release notes for version ${{ steps.bump_version.outputs.new_version }} + diff --git a/pyproject.toml b/pyproject.toml index 39ee025..4f0c68b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,3 +22,6 @@ classifiers = [ [project.urls] Homepage = "https://github.com/Sanjivani-S/DraftGPT" Issues = "https://github.com/Sanjivani-S/DraftGPT/issues" + +[project.dependencies] +requests = "*" diff --git a/src/DraftGPT/__init__.py b/src/DraftGPT/__init__.py index e69de29..f102a9c 100644 --- a/src/DraftGPT/__init__.py +++ b/src/DraftGPT/__init__.py @@ -0,0 +1 @@ +__version__ = "0.0.1"