diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 0000000..00b5f44 --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,11 @@ +[bumpversion] +current_version = 0.16.0 +commit = True +tag = True +tag_name = {new_version} +parse = (?P\d+)\.(?P\d+)\.(?P\d+)(?P(\.dev|rc)[0-9]+)? +serialize = + {major}.{minor}.{patch}{release} + {major}.{minor}.{patch} + +[bumpversion:file:pyproject.toml] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d428630..a72ecb7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,12 +1,19 @@ name: Build -on: [push, pull_request] +on: + push: + branches: [master] + tags: + - '[0-9]*' + pull_request: + branches: [master] + workflow_dispatch: env: PYTHONIOENCODING: "utf-8" jobs: - build: + tests: runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -33,3 +40,36 @@ jobs: with: python-version: 3.x - uses: pre-commit/action@v3.0.1 + + build-package: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Build package + run: | + pip install -U build + python -m build + - uses: actions/upload-artifact@v4 + with: + name: package + path: ./dist/* + + pypi-publish: + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + needs: [tests, style, build-package] + environment: + name: pypi + url: https://pypi.org/p/docstring-parser + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v4 + with: + name: package + path: dist + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.gitignore b/.gitignore index 799a0f3..9a945dd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ /.gitignore __pycache__ *.egg-info -.idea/ \ No newline at end of file +.idea/ +venv* +dist diff --git a/pyproject.toml b/pyproject.toml index 410d1a7..102b7a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "docstring_parser" -version = "0.16" +version = "0.16.0" description = "Parse Python docstrings in reST, Google and Numpydoc format" authors = [ {name="Marcin Kurczewski", email="dash@wind.garden"},