@@ -225,6 +225,11 @@ jobs:
225225 path : .
226226 type : local
227227 registry : pypi
228+ # OpenAPI-generated SDK (built from spec in this repo)
229+ - package : ogx-open-client
230+ path : client-sdks/openapi
231+ type : openapi-sdk
232+ registry : pypi
228233 # External packages (client SDKs from other repos)
229234 - package : ogx-client-python
230235 repo : ogx-ai/ogx-client-python
@@ -246,7 +251,7 @@ jobs:
246251
247252 if [ "$PACKAGES" == "all" ]; then
248253 echo "skip=false" >> "$GITHUB_OUTPUT"
249- elif [ "$PACKAGES" == "ogx-only" ] && [ "$TYPE" == "local" ]; then
254+ elif [ "$PACKAGES" == "ogx-only" ] && { [ "$TYPE" == "local" ] || [ "$TYPE" == "openapi-sdk" ]; } ; then
250255 echo "skip=false" >> "$GITHUB_OUTPUT"
251256 elif [ "$PACKAGES" == "clients-only" ] && [ "$TYPE" == "external" ]; then
252257 echo "skip=false" >> "$GITHUB_OUTPUT"
@@ -257,13 +262,13 @@ jobs:
257262
258263 # === LOCAL PACKAGE STEPS ===
259264 - name : Checkout local repo
260- if : steps.should-build.outputs.skip != 'true' && matrix.type == 'local'
265+ if : steps.should-build.outputs.skip != 'true' && ( matrix.type == 'local' || matrix.type == 'openapi-sdk')
261266 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
262267 with :
263268 fetch-depth : 0 # for setuptools-scm
264269
265270 - name : Install dependent PRs if needed
266- if : steps.should-build.outputs.skip != 'true' && matrix.type == 'local'
271+ if : steps.should-build.outputs.skip != 'true' && ( matrix.type == 'local' || matrix.type == 'openapi-sdk')
267272 uses : depends-on/depends-on-action@826c144163ac67bf08347590a5f81afd45da63ca # main
268273 with :
269274 token : ${{ secrets.GITHUB_TOKEN }}
@@ -350,6 +355,48 @@ jobs:
350355 env :
351356 SETUPTOOLS_SCM_PRETEND_VERSION : ${{ needs.compute-version.outputs.version }}
352357
358+ # === OPENAPI SDK BUILD (ogx-open-client) ===
359+ - name : Set up Java (openapi-sdk)
360+ if : steps.should-build.outputs.skip != 'true' && matrix.type == 'openapi-sdk'
361+ uses : actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
362+ with :
363+ distribution : ' temurin'
364+ java-version : ' 11'
365+
366+ - name : Set up Node.js (openapi-sdk)
367+ if : steps.should-build.outputs.skip != 'true' && matrix.type == 'openapi-sdk'
368+ uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
369+ with :
370+ node-version : ' 20'
371+
372+ - name : Install openapi-generator-cli (openapi-sdk)
373+ if : steps.should-build.outputs.skip != 'true' && matrix.type == 'openapi-sdk'
374+ run : npm install -g @openapitools/openapi-generator-cli
375+
376+ - name : Generate and build OpenAPI SDK
377+ if : steps.should-build.outputs.skip != 'true' && matrix.type == 'openapi-sdk'
378+ working-directory : ${{ matrix.path }}
379+ run : |
380+ VERSION="${{ needs.compute-version.outputs.version }}"
381+ echo "Generating SDK with OPEN=1 (ogx_open_client) at version ${VERSION}..."
382+ make sdk OPEN=1 VERSION="${VERSION}"
383+
384+ cd sdks/python
385+ echo "Building Python package..."
386+ uv build --out-dir ../../dist --no-build-isolation
387+
388+ - name : Verify OpenAPI SDK generation
389+ if : steps.should-build.outputs.skip != 'true' && matrix.type == 'openapi-sdk'
390+ working-directory : ${{ matrix.path }}
391+ run : |
392+ PY_FILE_COUNT=$(find sdks/python -name "*.py" | wc -l)
393+ echo "Generated Python files: $PY_FILE_COUNT"
394+ if [ "$PY_FILE_COUNT" -le 10 ]; then
395+ echo "::error::Too few Python files generated (expected > 10, got $PY_FILE_COUNT)"
396+ exit 1
397+ fi
398+ echo "SDK generated successfully"
399+
353400 # === EXTERNAL PYTHON PACKAGE BUILD ===
354401 - name : Check and bump version if exists on PyPI
355402 if : steps.should-build.outputs.skip != 'true' && matrix.type == 'external' && matrix.registry == 'pypi'
@@ -525,15 +572,15 @@ jobs:
525572 run : uv pip install --system twine check-wheel-contents
526573
527574 - name : Check wheel contents (local)
528- if : steps.should-build.outputs.skip != 'true' && matrix.type == 'local' && matrix.registry == 'pypi'
575+ if : steps.should-build.outputs.skip != 'true' && ( matrix.type == 'local' || matrix.type == 'openapi-sdk') && matrix.registry == 'pypi'
529576 run : check-wheel-contents --ignore W002,W004 ${{ matrix.path }}/dist/*.whl
530577
531578 - name : Check wheel contents (external)
532579 if : steps.should-build.outputs.skip != 'true' && matrix.type == 'external' && matrix.registry == 'pypi'
533580 run : check-wheel-contents --ignore W002,W004 external-repo/dist/*.whl
534581
535582 - name : Validate package with twine (local)
536- if : steps.should-build.outputs.skip != 'true' && matrix.type == 'local' && matrix.registry == 'pypi'
583+ if : steps.should-build.outputs.skip != 'true' && ( matrix.type == 'local' || matrix.type == 'openapi-sdk') && matrix.registry == 'pypi'
537584 run : twine check ${{ matrix.path }}/dist/*
538585
539586 - name : Validate package with twine (external)
@@ -542,7 +589,7 @@ jobs:
542589
543590 # === LIST AND UPLOAD ARTIFACTS ===
544591 - name : List dist contents (local)
545- if : steps.should-build.outputs.skip != 'true' && matrix.type == 'local'
592+ if : steps.should-build.outputs.skip != 'true' && ( matrix.type == 'local' || matrix.type == 'openapi-sdk')
546593 run : ls -la ${{ matrix.path }}/dist/
547594
548595 - name : List dist contents (external Python)
@@ -559,7 +606,7 @@ jobs:
559606 ls -la dist/
560607
561608 - name : Upload artifacts (local)
562- if : steps.should-build.outputs.skip != 'true' && matrix.type == 'local'
609+ if : steps.should-build.outputs.skip != 'true' && ( matrix.type == 'local' || matrix.type == 'openapi-sdk')
563610 uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
564611 with :
565612 name : Packages-${{ matrix.package }}
@@ -627,6 +674,14 @@ jobs:
627674 path : dist-client-ts
628675 continue-on-error : true
629676
677+ - name : Download ogx-open-client artifacts
678+ id : download-open-client
679+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
680+ with :
681+ name : Packages-ogx-open-client
682+ path : dist-open-client
683+ continue-on-error : true
684+
630685 - name : Create venv and install Python packages
631686 run : |
632687 uv venv .venv
@@ -648,6 +703,11 @@ jobs:
648703 uv pip install dist-stack/*.whl
649704 fi
650705
706+ if [ -d "dist-open-client" ] && ls dist-open-client/*.whl 1>/dev/null 2>&1; then
707+ echo "Installing ogx-open-client..."
708+ uv pip install dist-open-client/*.whl
709+ fi
710+
651711 - name : List Wheel Contents (ogx-api)
652712 if : steps.download-api.outcome == 'success'
653713 run : |
@@ -681,6 +741,10 @@ jobs:
681741 python -c "import ogx_client; print(f'ogx_client imported successfully from {ogx_client.__file__}')"
682742 fi
683743
744+ if [ -d "dist-open-client" ] && ls dist-open-client/*.whl 1>/dev/null 2>&1; then
745+ python -c "import ogx_open_client; print(f'ogx_open_client imported successfully from {ogx_open_client.__file__}')"
746+ fi
747+
684748 - name : Verify TypeScript package
685749 if : steps.download-client-ts.outcome == 'success'
686750 run : |
@@ -700,7 +764,7 @@ jobs:
700764 fi
701765
702766 # Publish packages to PyPI/npm
703- # Order: ogx-client-python, ogx-client-typescript, ogx-api, ogx
767+ # Order: ogx-client-python, ogx-client-typescript, ogx-open-client, ogx- api, ogx
704768 publish-packages :
705769 name : Publish ${{ matrix.package }}
706770 if : |
@@ -727,6 +791,9 @@ jobs:
727791 - package : ogx-client-typescript
728792 registry : npm
729793 type : external
794+ - package : ogx-open-client
795+ registry : pypi
796+ type : openapi-sdk
730797 - package : ogx-api
731798 registry : pypi
732799 type : local
@@ -745,7 +812,7 @@ jobs:
745812
746813 if [ "$PACKAGES" == "all" ]; then
747814 echo "skip=false" >> "$GITHUB_OUTPUT"
748- elif [ "$PACKAGES" == "ogx-only" ] && [ "$TYPE" == "local" ]; then
815+ elif [ "$PACKAGES" == "ogx-only" ] && { [ "$TYPE" == "local" ] || [ "$TYPE" == "openapi-sdk" ]; } ; then
749816 echo "skip=false" >> "$GITHUB_OUTPUT"
750817 elif [ "$PACKAGES" == "clients-only" ] && [ "$TYPE" == "external" ]; then
751818 echo "skip=false" >> "$GITHUB_OUTPUT"
0 commit comments