Skip to content
This repository was archived by the owner on Mar 26, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/docs-generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Generate Python Docs on SDK Update

on:
push:
branches:
- main
paths:
- 'hatchet_sdk/clients/rest/**'

jobs:
trigger:
runs-on: ubuntu-latest
permissions: write-all

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Checkout Go Repo
uses: actions/checkout@v4
with:
token: ${{ secrets.TOKEN }}
repository: hatchet-dev/hatchet
path: ./hatchet

- name: Generate Docs
run: |
pip install pydoc-markdown
pydoc-markdown -p hatchet_sdk/clients/rest --render-toc > docs.md

# Copy all contexts of docs.md to hatchet/frontend/docs/gen/python
mkdir -p ./hatchet/frontend/docs/gen/python
cp docs.md ./hatchet/frontend/docs/gen/python

- name: Commit and Push changes to Hatchet Repo
run: |
cd hatchet
git remote -v
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b feat/actions/generate-python-docs
git add .
git commit -m "feat: generate Python Docs"
git push origin feat/actions/generate-python-docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Pull Request
run: |
cd hatchet
gh pr create -R hatchet-dev/hatchet -B main -H feat/actions/generate-python-docs --title 'Generate Python Docs' --body 'This PR generates Python Docs for updated openapi spec.'
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
49 changes: 49 additions & 0 deletions .github/workflows/sdk-generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Generate SDK Client and Make PR

on:
repository_dispatch:
types: [generate-sdk]

jobs:
trigger:
runs-on: ubuntu-latest
permissions: write-all

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.TOKEN }}
- name: 'Checkout hatchet submodule'
uses: actions/checkout@v4
with:
token: ${{ secrets.TOKEN }}
repository: hatchet-dev/hatchet
path: ./hatchet
- name: Generate Python SDK Client
run: |
# Run generation script
pip install poetry
pip install pre-commit
python3 -m venv /home/runner/.cache/pypoetry/virtualenvs/hatchet-sdk-6GHYpsTj-py3.10
source /home/runner/.cache/pypoetry/virtualenvs/hatchet-sdk-6GHYpsTj-py3.10/bin/activate
pip install grpcio grpcio-tools
deactivate
bash generate.sh
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b feat/actions/generate-python-sdk-client
git add .
git commit -m "feat: generate Python SDK client"

- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: feat/actions/generate-python-sdk-client

- name: create pull request
run: gh pr create -B main -H feat/actions/generate-python-sdk-client --title 'Generate Python SDK client' --body 'This PR generates a Python SDK client for updated openapi spec.'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}