mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-22 13:34:17 +02:00
feat: Improve GitHub workflow automation for schema and SDK docs (#1615)
This commit is contained in:
parent
e6eb6ae006
commit
d237de2003
2 changed files with 15 additions and 36 deletions
32
.github/workflows/update-config-schema.yml
vendored
32
.github/workflows/update-config-schema.yml
vendored
|
|
@ -42,32 +42,29 @@ jobs:
|
|||
- name: Generate config schema
|
||||
run: |
|
||||
echo "🔄 Generating fastmcp.json schema..."
|
||||
|
||||
# Generate schema in docs/public for web access
|
||||
uv run python -c "
|
||||
from fastmcp.utilities.fastmcp_config import generate_schema
|
||||
generate_schema('docs/public/schemas/fastmcp.json/latest.json')
|
||||
print('✅ Schema generated successfully')
|
||||
print('✅ Latest schema generated in docs/public')
|
||||
"
|
||||
|
||||
# Also update the v1 schema for consistency
|
||||
# Also update the v1 schema in docs/public
|
||||
uv run python -c "
|
||||
from fastmcp.utilities.fastmcp_config import generate_schema
|
||||
generate_schema('docs/public/schemas/fastmcp.json/v1.json')
|
||||
print('✅ v1 schema updated')
|
||||
print('✅ v1 schema generated in docs/public')
|
||||
"
|
||||
|
||||
- name: Check for changes
|
||||
id: check_changes
|
||||
run: |
|
||||
if git diff --quiet docs/public/schemas/fastmcp.json/; then
|
||||
echo "No changes detected in config schema"
|
||||
echo "has_changes=false" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "Changes detected in config schema"
|
||||
echo "has_changes=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
# Generate schema in the source directory for local development
|
||||
uv run python -c "
|
||||
from fastmcp.utilities.fastmcp_config import generate_schema
|
||||
generate_schema('src/fastmcp/utilities/fastmcp_config/v1/schema.json')
|
||||
print('✅ Schema generated in utilities/fastmcp_config/v1/')
|
||||
"
|
||||
|
||||
- name: Create Pull Request
|
||||
if: steps.check_changes.outputs.has_changes == 'true'
|
||||
uses: peter-evans/create-pull-request@v7
|
||||
with:
|
||||
token: ${{ steps.marvin-token.outputs.token }}
|
||||
|
|
@ -86,8 +83,5 @@ jobs:
|
|||
|
||||
- name: Summary
|
||||
run: |
|
||||
if [ "${{ steps.check_changes.outputs.has_changes }}" == "true" ]; then
|
||||
echo "✅ Config schema PR created"
|
||||
else
|
||||
echo "✅ Config schema is already up to date"
|
||||
fi
|
||||
echo "✅ Config schema generation workflow completed"
|
||||
echo "PR will be created if there are changes, or closed if schema is already up to date"
|
||||
|
|
|
|||
19
.github/workflows/update-sdk-docs.yml
vendored
19
.github/workflows/update-sdk-docs.yml
vendored
|
|
@ -47,19 +47,7 @@ jobs:
|
|||
echo "🔄 Generating SDK documentation..."
|
||||
just api-ref-all
|
||||
|
||||
- name: Check for changes
|
||||
id: check_changes
|
||||
run: |
|
||||
if git diff --quiet docs/python-sdk/ docs/docs.json; then
|
||||
echo "No changes detected in SDK documentation"
|
||||
echo "has_changes=false" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "Changes detected in SDK documentation"
|
||||
echo "has_changes=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Create Pull Request
|
||||
if: steps.check_changes.outputs.has_changes == 'true'
|
||||
uses: peter-evans/create-pull-request@v7
|
||||
with:
|
||||
token: ${{ steps.marvin-token.outputs.token }}
|
||||
|
|
@ -78,8 +66,5 @@ jobs:
|
|||
|
||||
- name: Summary
|
||||
run: |
|
||||
if [ "${{ steps.check_changes.outputs.has_changes }}" == "true" ]; then
|
||||
echo "✅ SDK documentation PR created"
|
||||
else
|
||||
echo "✅ SDK documentation is already up to date"
|
||||
fi
|
||||
echo "✅ SDK documentation generation workflow completed"
|
||||
echo "PR will be created if there are changes, or closed if documentation is already up to date"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue