Skip to content

v0.6.56

v0.6.56 #63

name: Publish SDKs and MCP
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: "Version to release (e.g., v0.5.8)"
required: true
type: string
jobs:
generate-sdks-and-mcp:
runs-on: ubuntu-latest
permissions:
contents: write
actions: write
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: Install Python dependencies
working-directory: ./backend
run: |
poetry install
- name: Generate OpenAPI specification
run: |
echo "Generating OpenAPI specification..."
poetry run python ../fern/scripts/generate_openapi.py
working-directory: ./backend
env:
FIRST_SUPERUSER: "[email protected]"
FIRST_SUPERUSER_PASSWORD: "docs-password"
ENCRYPTION_KEY: "docs-encryption-key"
POSTGRES_HOST: "localhost"
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
OPENAI_API_KEY: "sk-docs"
LOCAL_DEVELOPMENT: "true"
STATE_SECRET: "dummy-state-secret-key-1234567890-abcdefghijklmn"
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install Fern
run: npm install -g fern-api
- name: Generate SDKs with version
env:
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
cd fern
VERSION=${{ github.event.release.tag_name || github.event.inputs.version }}
fern generate --group public --version $VERSION --log-level debug
- name: Update MCP package version
run: |
cd mcp
VERSION=${{ github.event.release.tag_name || github.event.inputs.version }}
# Remove 'v' prefix if present
VERSION=${VERSION#v}
npm version $VERSION --no-git-tag-version
echo "Updated MCP package to version $VERSION"
- name: Build MCP package
run: |
cd mcp
npm install
npm run build
- name: Publish MCP to npm
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cd mcp
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
npm publish --access public
echo "Published airweave-mcp-search to npm"
- name: Trigger Docs Generation
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'fern-docs.yml',
ref: 'main'
})