diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ca8ed72..c046e98 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,18 +14,23 @@ jobs: outputs: release_created: ${{ steps.release.outputs.release_created }} steps: + # Versioning lives in release-please-config.json and + # .release-please-manifest.json; passing release-type here would make + # the action ignore both and fall back to 0.1.0 (no v1.0.0 tag exists). - uses: googleapis/release-please-action@v4 id: release - with: - release-type: python - package-name: apinator-server publish: needs: release-please if: needs.release-please.outputs.release_created runs-on: ubuntu-latest + # Trusted publishing: PyPI exchanges this job's GitHub OIDC token for a + # short-lived upload credential, so no PyPI token secret is stored. + # Configured on pypi.org (project -> Publishing) for owner apinator-io, + # repo sdk-python, workflow release.yml, environment pypi. environment: pypi permissions: + contents: read id-token: write steps: - uses: actions/checkout@v4 @@ -35,8 +40,11 @@ jobs: with: python-version: "3.12" - - name: Install build tools - run: pip install build + - name: Install build and test tools + run: pip install build pytest + + - name: Test + run: pytest tests/ -q - name: Build package run: python -m build diff --git a/.gitignore b/.gitignore index 5775994..0d528c0 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ build/ .pytest_cache/ .mypy_cache/ .DS_Store +.coverage diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..37fcefa --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "1.0.0" +} diff --git a/apinator/__init__.py b/apinator/__init__.py index b684da5..d6a4e61 100644 --- a/apinator/__init__.py +++ b/apinator/__init__.py @@ -7,7 +7,7 @@ from .webhook import verify_webhook from .errors import RealtimeError, AuthenticationError, ValidationError, ApiError -__version__ = "1.0.0" +__version__ = "1.0.0" # x-release-please-version __all__ = [ "Apinator", "authenticate_channel", diff --git a/pyproject.toml b/pyproject.toml index d9fb2c7..575b2c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,12 @@ classifiers = [ "Programming Language :: Python :: 3.12", ] +[project.urls] +Homepage = "https://apinator.io" +Documentation = "https://apinator.io/documentation/#sdk-python" +Source = "https://github.com/apinator-io/sdk-python" +Changelog = "https://github.com/apinator-io/sdk-python/blob/main/CHANGELOG.md" + [project.optional-dependencies] dev = ["pytest>=7.0", "pytest-cov>=4.0"] diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..9d663dc --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "bootstrap-sha": "97e43871f7c985870d24ab5dfb71b8b5043ab031", + "include-component-in-tag": false, + "packages": { + ".": { + "release-type": "python", + "package-name": "apinator-server", + "extra-files": ["apinator/__init__.py"] + } + } +}