chore: tweaks

This commit is contained in:
Adam Uhlíř 2024-12-19 13:21:39 +01:00
parent eed5ea7a59
commit b2e6180ed1
No known key found for this signature in database
GPG Key ID: 1D17A9E81F76155B
9 changed files with 22 additions and 19 deletions

View File

@ -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'

View File

@ -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'

View File

@ -1,4 +1,3 @@
.github/workflows/python.yml
.gitignore
README.md
codex_api_client/__init__.py

View File

@ -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

View File

@ -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

View File

@ -494,7 +494,7 @@ class Configuration:
"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]:

View File

@ -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

View File

@ -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 <team@openapitools.org>"]
license = "NoLicense"

View File

@ -20,8 +20,8 @@ from setuptools import setup, find_packages # noqa: H301
#
# 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",