Skip to content

📦 Release SDK

📦 Release SDK #40

Workflow file for this run

# Manual SDK release workflow.
# Use this workflow to run SDK releases directly from GitHub Actions.
name: "\U0001F4E6 Release SDK (manual fallback)"
on:
workflow_dispatch:
inputs:
version:
description: "Version to release (e.g. 1.0.0-alpha.7). Leave empty to release the current version."
required: false
type: string
dry-run:
description: "Dry run — build and validate without publishing"
required: false
type: boolean
default: false
npm-tag:
description: "npm dist-tag for Node SDK publish (e.g. latest, next)"
required: false
type: string
default: latest
permissions:
contents: read
id-token: write # PyPI trusted publishing (OIDC)
concurrency:
group: release-sdk
cancel-in-progress: false
jobs:
release:
runs-on: ubuntu-24.04
environment: ${{ inputs.dry-run && '' || 'pypi' }}
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: pnpm
registry-url: "https://registry.npmjs.org"
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Install Python build tools
run: pip install build
# ---------------------------------------------------------------
# Show current version (visible in the Actions run summary)
# ---------------------------------------------------------------
- name: Show current version
run: |
CURRENT=$(node -p "require('./packages/sdk/package.json').version")
echo "### SDK Release" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| | Version |" >> $GITHUB_STEP_SUMMARY
echo "|---|---|" >> $GITHUB_STEP_SUMMARY
echo "| **Current (in repo)** | \`${CURRENT}\` |" >> $GITHUB_STEP_SUMMARY
if [ -n "${{ inputs.version }}" ]; then
echo "| **Releasing** | \`${{ inputs.version }}\` |" >> $GITHUB_STEP_SUMMARY
else
echo "| **Releasing** | \`${CURRENT}\` (unchanged) |" >> $GITHUB_STEP_SUMMARY
fi
echo "| **Dry run** | \`${{ inputs.dry-run }}\` |" >> $GITHUB_STEP_SUMMARY
echo "| **npm tag** | \`${{ inputs.npm-tag }}\` |" >> $GITHUB_STEP_SUMMARY
# ---------------------------------------------------------------
# Set version (if provided)
# ---------------------------------------------------------------
- name: Set version
if: inputs.version != ''
run: node packages/sdk/scripts/sync-sdk-version.mjs --set "${{ inputs.version }}"
# ---------------------------------------------------------------
# Generate + validate
# ---------------------------------------------------------------
- name: Generate all artifacts
run: pnpm run generate:all
# ---------------------------------------------------------------
# Node SDK
# ---------------------------------------------------------------
- name: Build Node SDK
run: pnpm --prefix packages/sdk/langs/node run build
- name: Build superdoc package for CLI native bundling
run: pnpm --prefix packages/superdoc run build:es
- name: Verify superdoc build output exists
run: |
test -f packages/superdoc/dist/super-editor.es.js \
|| (echo "FATAL: packages/superdoc/dist/super-editor.es.js missing — build:es likely failed silently" && exit 1)
- name: Validate SDK
run: node packages/sdk/scripts/sdk-validate.mjs
- name: Publish Node SDK packages (platforms + root)
if: ${{ !inputs.dry-run }}
run: node packages/sdk/scripts/sdk-release-publish.mjs --tag "${{ inputs.npm-tag }}" --npm-only
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish Node SDK packages (dry run)
if: ${{ inputs.dry-run }}
run: node packages/sdk/scripts/sdk-release-publish.mjs --tag "${{ inputs.npm-tag }}" --npm-only --dry-run
# ---------------------------------------------------------------
# Python SDK (main + 5 companion packages)
# ---------------------------------------------------------------
- name: Build and verify Python SDK
run: node packages/sdk/scripts/build-python-sdk.mjs
# Publish companions first — root depends on them being on PyPI.
- name: Publish companion Python packages to PyPI
if: ${{ !inputs.dry-run }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: packages/sdk/langs/python/companion-dist/
skip-existing: true
# Publish root last.
- name: Publish main Python SDK to PyPI
if: ${{ !inputs.dry-run }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: packages/sdk/langs/python/dist/
skip-existing: true
- name: Publish Python SDK (dry run)
if: ${{ inputs.dry-run }}
run: |
echo "=== Companion wheels ==="
ls -la packages/sdk/langs/python/companion-dist/
echo "=== Root wheel ==="
ls -la packages/sdk/langs/python/dist/