From b2e6180ed11c0199cff6122531afbabbea53817b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Uhl=C3=AD=C5=99?= Date: Thu, 19 Dec 2024 13:21:39 +0100 Subject: [PATCH] chore: tweaks --- .github/workflows/generate.yml | 7 ++++++- .github/workflows/release.yml | 17 ++++++++--------- .openapi-generator/FILES | 1 - README.md | 4 ++-- codex_api_client/__init__.py | 2 +- codex_api_client/configuration.py | 2 +- generate.sh | 2 +- pyproject.toml | 2 +- setup.py | 4 ++-- 9 files changed, 22 insertions(+), 19 deletions(-) diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index df16ecf..cf2db09 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -6,7 +6,7 @@ permissions: on: repository_dispatch: - types: [generate] + types: [generate, release] workflow_dispatch: inputs: openapi_url: @@ -25,6 +25,10 @@ jobs: echo "Error: 'openapi_url' is missing in client_payload." exit 1 fi + if [ "${{ github.event.action }}" == "release" ] && [ -z "${{ github.event.client_payload.version }}" ]; then + echo "Error: We are supposed to release, but 'version' is missing in client_payload." + exit 1 + fi echo "OPENAPI_URL=${{ github.event.client_payload.openapi_url }}" >> $GITHUB_ENV else @@ -56,5 +60,6 @@ jobs: branch: generator delete-branch: 'true' title: 'Generated API update' + body: 'Update of the client library using OpenAPI from: ${{ env.OPENAPI_URL }}' commit-message: 'Generated API update' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index af59779..e65dc55 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,8 @@ name: Release +permissions: + contents: write + on: release: types: [published] @@ -8,12 +11,10 @@ jobs: publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - + - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 20 - cache: 'npm' - name: Install OpenAPI Generator run: npm install @openapitools/openapi-generator-cli -g @@ -35,10 +36,8 @@ jobs: with: password: ${{ secrets.PYPI_API_TOKEN }} - - name: Create Pull Request - uses: peter-evans/create-pull-request@v7 + - name: Push the changes + uses: stefanzweifel/git-auto-commit-action@v5 with: - branch: released - delete-branch: 'true' - title: 'Version update' - commit-message: 'Version update after release' + branch: master + commit_message: 'Version bump' diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 2900917..eae67d9 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.github/workflows/python.yml .gitignore README.md codex_api_client/__init__.py diff --git a/README.md b/README.md index f8cb7a2..0389e54 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# Codex API Client +# codex-api-client List of endpoints and interfaces available to Codex API users This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 0.0.1 -- Package version: 0.0.1 +- Package version: 0.1.0 - Generator version: 7.10.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen diff --git a/codex_api_client/__init__.py b/codex_api_client/__init__.py index 4634a8b..bb7a262 100644 --- a/codex_api_client/__init__.py +++ b/codex_api_client/__init__.py @@ -14,7 +14,7 @@ """ # noqa: E501 -__version__ = "0.0.1" +__version__ = "0.1.0" # import apis into sdk package from codex_api_client.api.data_api import DataApi diff --git a/codex_api_client/configuration.py b/codex_api_client/configuration.py index 7587b9e..6e4fcbe 100644 --- a/codex_api_client/configuration.py +++ b/codex_api_client/configuration.py @@ -494,7 +494,7 @@ def to_debug_report(self) -> str: "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 0.0.1\n"\ - "SDK Package Version: 0.0.1".\ + "SDK Package Version: 0.1.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/generate.sh b/generate.sh index 860fb19..80681ac 100755 --- a/generate.sh +++ b/generate.sh @@ -10,6 +10,6 @@ openapi-generator-cli generate \ -t .openapi-generator/templates \ -g python \ -i codex.yaml \ - --additional-properties="packageName=codex_api_client,projectName=Codex\ API\ Client,packageUrl=https://github.com/codex-storage/py-codex-api-client,packageVersion=$1" \ + --additional-properties="packageName=codex_api_client,projectName=codex-api-client,packageUrl=https://github.com/codex-storage/py-codex-api-client,packageVersion=$1" \ --git-repo-id py-codex-api-client --git-user-id codex-storage \ --http-user-agent py_codex_api_client diff --git a/pyproject.toml b/pyproject.toml index b9e5229..9264367 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "codex_api_client" -version = "0.0.1" +version = "0.1.0" description = "Codex API" authors = ["OpenAPI Generator Community "] license = "NoLicense" diff --git a/setup.py b/setup.py index 9afc8b9..dce2310 100644 --- a/setup.py +++ b/setup.py @@ -20,8 +20,8 @@ # # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -NAME = "Codex API Client" -VERSION = "0.0.1" +NAME = "codex-api-client" +VERSION = "0.1.0" PYTHON_REQUIRES = ">= 3.8" REQUIRES = [ "urllib3 >= 1.25.3, < 3.0.0",