Skip to content

Publish

Publish #3

Workflow file for this run

# Publish TypeScript (npm) and Python (PyPI) SDKs.
#
# Triggers:
# - workflow_dispatch: manual publish from the selected ref (typically main).
# - workflow_run: after "Release tag check" succeeds (tag push → verify → then publish).
#
# Required repo secrets: NPM_TOKEN, PYPI_API_TOKEN
name: Publish SDKs
on:
workflow_dispatch:
workflow_run:
workflows: ["Release tag check"]
types:
- completed
jobs:
publish:
if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout (manual)
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v4
- name: Checkout (release tag commit)
if: github.event_name == 'workflow_run'
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha }}
- uses: oven-sh/setup-bun@v2
with:
bun-version: "latest"
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/setup-node@v4
with:
registry-url: https://registry.npmjs.org
- name: Install and verify versions
run: bun install --frozen-lockfile && bun run scripts/verify-versions.ts
- name: Build TypeScript SDK
run: bun run build:typescript
- name: Build Python package
working-directory: sdks/python
run: |
python3 -m pip install --upgrade pip build twine
python3 -m build
- name: Publish to npm
working-directory: sdks/typescript
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish to PyPI
working-directory: sdks/python
run: python3 -m twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}