Fix #209
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate SDK | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
generate-sdk: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
echo "export PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV | |
- name: Install dependencies | |
run: | | |
cd backend | |
poetry install | |
- name: Generate SDK | |
run: | | |
cd backend | |
poetry run python generate_client_sdk.py -o ../frontend/sdk | |
- name: Commit and push SDK | |
run: | | |
cd frontend/sdk | |
if [ -n "$(git status --porcelain)" ]; then | |
git config --local user.name "github-actions[bot]" | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git add . | |
git commit -m "Auto-generate SDK [skip ci]" | |
git push | |
else | |
echo "No changes to commit." | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |