diff --git a/.github/workflows/generate_client.yaml b/.github/workflows/generate_client.yaml new file mode 100644 index 00000000..9ac75680 --- /dev/null +++ b/.github/workflows/generate_client.yaml @@ -0,0 +1,46 @@ +--- +name: Auto generate Client Code + +on: + push: + branches: [main] + + +env: + POETRY_VERSION: "1.8.4" + +jobs: + publish-to-pypi: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + Poetry ${{ env.POETRY_VERSION }} + uses: "./.github/actions/poetry_setup" + with: + python-version: "3.10" + poetry-version: ${{ env.POETRY_VERSION }} + working-directory: ${{ matrix.package.workdir }} + cache-key: release + + - name: Install infinity + run: | + pip install libs/infinity_emb[all] + + - name: Generate Client + working-directory: libs/client_infinity + run: | + ./run_generate_with_hook.sh + + - name: Test Generated Client + working-directory: libs/client_infinity + run: + ./run_tets_with_hook.sh + + - name: "Open a PR" + uses: peter-evans/create-pull-request@v7 \ No newline at end of file diff --git a/.github/workflows/pypi_release.yaml b/.github/workflows/pypi_release.yaml index f835ba32..69da3506 100644 --- a/.github/workflows/pypi_release.yaml +++ b/.github/workflows/pypi_release.yaml @@ -26,24 +26,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Compare versions - working-directory: ${{ github.workspace }} - run: | - file1="libs/client_infinity/infinity_client/pyproject.toml" - file2="libs/infinity_emb/pyproject.toml" - - version1=$(grep 'version = ' "$file1" | sed 's/version = //' | tr -d '\"') - version2=$(grep 'version = ' "$file2" | sed 's/version = //' | tr -d '\"') - - echo "Version 1: $version1" - echo "Version 2: $version2" - - if [ "$version1" != "$version2" ]; then - echo "Version mismatch: $version1 != $version2" - exit 1 - else - echo "Versions match: $version1 == $version2" - - name: Set up Python + Poetry ${{ env.POETRY_VERSION }} uses: "./.github/actions/poetry_setup" with: