Skip to content

Commit

Permalink
initial action for generating client
Browse files Browse the repository at this point in the history
  • Loading branch information
wirthual committed Feb 1, 2025
1 parent 78465de commit fc01cff
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 18 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/generate_client.yaml
Original file line number Diff line number Diff line change
@@ -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
18 changes: 0 additions & 18 deletions .github/workflows/pypi_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit fc01cff

Please sign in to comment.