Skip to content

Commit

Permalink
chore: tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
AuHau committed Dec 19, 2024
1 parent eed5ea7 commit b2e6180
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 19 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ permissions:

on:
repository_dispatch:
types: [generate]
types: [generate, release]
workflow_dispatch:
inputs:
openapi_url:
Expand All @@ -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
Expand Down Expand Up @@ -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'

17 changes: 8 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Release

permissions:
contents: write

on:
release:
types: [published]
Expand All @@ -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
Expand All @@ -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'
1 change: 0 additions & 1 deletion .openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.github/workflows/python.yml
.gitignore
README.md
codex_api_client/__init__.py
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion codex_api_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion codex_api_client/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down
2 changes: 1 addition & 1 deletion generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit b2e6180

Please sign in to comment.