Skip to content
This repository was archived by the owner on Aug 29, 2026. It is now read-only.

v0.9.72

v0.9.72 #305

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
id-token: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.13"
- name: Install Poetry
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
with:
version: 2.3.2
virtualenvs-create: false
- 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: "docs@example.com"
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"
SVIX_JWT_SECRET: "dummy-svix-jwt-secret-1234567890-abcdefghijklmn"
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
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: Install mcp-publisher
run: |
curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
- name: Update server.json version and publish to MCP Registry
working-directory: ./mcp
run: |
VERSION=${{ github.event.release.tag_name || github.event.inputs.version }}
VERSION=${VERSION#v}
jq --arg v "$VERSION" '.version = $v | .packages[0].version = $v' server.json > server.tmp && mv server.tmp server.json
../mcp-publisher login github-oidc
../mcp-publisher publish
# ── Connect SDK packages ────────────────────────────────────────
- name: Install Connect widget dependencies
run: |
cd connect
npm ci
- name: Build and publish @airweave/connect-js
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
VERSION=${{ github.event.release.tag_name || github.event.inputs.version }}
VERSION=${VERSION#v}
cd connect/packages/js
npm ci
npm version $VERSION --no-git-tag-version
npm run build
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
npm publish --access public
echo "Published @airweave/connect-js@$VERSION to npm"
- name: Build and publish @airweave/connect-react
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
VERSION=${{ github.event.release.tag_name || github.event.inputs.version }}
VERSION=${VERSION#v}
cd connect/packages/react
npm ci
npm version $VERSION --no-git-tag-version
npm run build
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
npm publish --access public
echo "Published @airweave/connect-react@$VERSION to npm"
- name: Trigger Docs Generation
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
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'
})