From 3abdc9db0f8c96c318717294780c3781a2376da0 Mon Sep 17 00:00:00 2001 From: Evgeniy Krysanov Date: Wed, 2 Oct 2024 16:56:33 +0300 Subject: [PATCH 1/2] chore(poetry): add Python package information for publishing to PyPI --- pyproject.toml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 34ace32..db7e6cd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "spec2sdk" -version = "0.1.0" +version = "1.1+SNAPSHOT" description = "Generate Pydantic models and API client code from OpenAPI 3.x specifications" authors = ["moneymeets "] readme = "README.md" @@ -8,6 +8,16 @@ repository = "https://github.com/moneymeets/spec2sdk" packages = [ { include="spec2sdk" }, ] +keywords = ["openapi", "pydantic", "code-generator", "openapi-codegen"] +license = "MIT" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.12", + "Topic :: Software Development :: Libraries :: Python Modules", + "License :: OSI Approved :: MIT License", +] [tool.poetry.dependencies] python = "~3.12" From cbd9d36668ee7b4ed1f0eb9f3b3742aeaddb4350 Mon Sep 17 00:00:00 2001 From: Evgeniy Krysanov Date: Wed, 2 Oct 2024 16:56:47 +0300 Subject: [PATCH 2/2] ci(actions): add workflow to publish Python package to PyPI --- .github/workflows/publish.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..1ba468a --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,23 @@ +name: Publish +on: + push: + branches: + - master + +jobs: + publish-package: + runs-on: ubuntu-24.04 + timeout-minutes: 10 + + steps: + - uses: actions/checkout@v4 + + - uses: moneymeets/action-setup-python-poetry@master + + - name: Publish package + run: | + sed -i -e "s/1+SNAPSHOT/0.$(date +"%Y%m%d%H%M")/" pyproject.toml + git rev-parse HEAD > VERSION.txt + poetry publish --build + env: + POETRY_PYPI_TOKEN_PYPI: ${{ secrets.POETRY_PYPI_TOKEN_PYPI }}