Update Timestep SDK version to 2026.0.8 and enhance publish workflow … #26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Packages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| test: | |
| name: Run Behavior Tests | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| version: "latest" | |
| - name: Set up pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.17.1 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| cache-dependency-path: 'typescript/pnpm-lock.yaml' | |
| - name: Install Python dependencies | |
| run: | | |
| cd python | |
| uv venv | |
| uv pip install --force-reinstall ../3rdparty/openai-agents-python | |
| uv run python vendor_openai_agents.py | |
| uv sync | |
| # Reinstall agents package after sync (needed for vendored imports to work) | |
| uv pip install --force-reinstall ../3rdparty/openai-agents-python | |
| - name: Build submodule dependencies | |
| run: | | |
| cd 3rdparty/openai-agents-js | |
| pnpm install | |
| pnpm build | |
| - name: Install TypeScript dependencies | |
| run: | | |
| cd typescript | |
| pnpm install --frozen-lockfile | |
| - name: Install PGLite for Python subprocess | |
| run: | | |
| # Install globally for Python subprocess to find it | |
| npm install -g @electric-sql/pglite | |
| # Also install in project root as fallback | |
| npm install @electric-sql/pglite | |
| - name: Run Python tests | |
| run: | | |
| cd python | |
| uv run pytest tests/test_run_agent.py -v -x | |
| uv run pytest tests/test_same_language_py_to_py.py -v -x | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| - name: Run TypeScript tests | |
| run: | | |
| cd typescript | |
| npx tsx tests/test_run_agent.ts | |
| npx tsx tests/test_same_language_ts_to_ts.ts | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| - name: Run cross-language tests (TypeScript to Python) | |
| run: | | |
| cd typescript | |
| npx tsx tests/test_cross_language_ts_to_py.ts | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| - name: Run cross-language tests (Python to TypeScript) | |
| run: | | |
| cd python | |
| uv run pytest tests/test_cross_language_py_to_ts.py -v -x | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| publish-python: | |
| name: Publish Python Package to PyPI | |
| runs-on: ubuntu-latest | |
| needs: test | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| version: "latest" | |
| - name: Read version from pyproject.toml | |
| id: read_version | |
| run: | | |
| cd python | |
| VERSION=$(grep -E '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/') | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Using version: $VERSION" | |
| - name: Vendor dependencies | |
| run: | | |
| cd python | |
| python3 vendor_openai_agents.py | |
| - name: Build package | |
| run: | | |
| cd python | |
| uv build | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: python/dist/ | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |
| publish-typescript: | |
| name: Publish TypeScript Package to npm | |
| runs-on: ubuntu-latest | |
| needs: test | |
| permissions: | |
| contents: read | |
| id-token: write # Required for trusted publishing to npm | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Set up pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.17.1 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://registry.npmjs.org' | |
| cache: 'pnpm' | |
| cache-dependency-path: 'typescript/pnpm-lock.yaml' | |
| - name: Read version from package.json | |
| id: read_version | |
| run: | | |
| cd typescript | |
| VERSION=$(grep -E '"version"' package.json | sed 's/.*"version": "\(.*\)".*/\1/' | head -1) | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Using version: $VERSION" | |
| - name: Build submodule dependencies | |
| run: | | |
| cd 3rdparty/openai-agents-js | |
| pnpm install | |
| pnpm build | |
| - name: Install dependencies | |
| run: | | |
| cd typescript | |
| pnpm install --frozen-lockfile | |
| - name: Build package | |
| run: | | |
| cd typescript | |
| pnpm run build | |
| - name: Publish to npm | |
| run: | | |
| cd typescript | |
| pnpm publish --access public --no-git-checks | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| deploy-docs: | |
| name: Deploy Documentation to GitHub Pages | |
| runs-on: ubuntu-latest | |
| needs: test | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install documentation dependencies | |
| run: | | |
| cd docs | |
| pip install -r requirements-docs.txt | |
| - name: Build documentation | |
| run: | | |
| cd docs | |
| mkdocs build | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/site | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |