Skip to content

Release Integration Packages #41

Release Integration Packages

Release Integration Packages #41

name: Release Integration Packages
# Tag scheme: zep-<framework>-<language>-v<version>
# e.g. zep-adk-python-v0.2.0, zep-mastra-typescript-v0.1.0
# Go modules are NOT released here — they are versioned by a tag matching the module
# subpath, integrations/<framework>/go/vX.Y.Z, consumed via
# go get github.com/getzep/zep/integrations/<framework>/go@vX.Y.Z
on:
release:
types: [published]
workflow_dispatch:
inputs:
framework:
description: 'Framework key (directory under integrations/, e.g. adk, crewai)'
required: true
language:
description: 'Language'
required: true
type: choice
options:
- python
- typescript
permissions:
contents: read
id-token: write
jobs:
detect:
runs-on: ubuntu-latest
outputs:
framework: ${{ steps.detect.outputs.framework }}
language: ${{ steps.detect.outputs.language }}
steps:
- name: Detect framework + language
id: detect
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "framework=${{ github.event.inputs.framework }}" >> "$GITHUB_OUTPUT"
echo "language=${{ github.event.inputs.language }}" >> "$GITHUB_OUTPUT"
else
TAG="${{ github.event.release.tag_name }}"
# zep-<framework>-<language>-v<version>
if [[ $TAG =~ ^zep-(.+)-(python|typescript)-v.*$ ]]; then
echo "framework=${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT"
echo "language=${BASH_REMATCH[2]}" >> "$GITHUB_OUTPUT"
else
echo "Tag '$TAG' does not match zep-<framework>-<language>-v<version>."
echo "Go modules release via the tag integrations/<framework>/go/vX.Y.Z, not this workflow."
exit 1
fi
fi
# ---------------------------------------------------------------- Python → PyPI
test-python:
if: needs.detect.outputs.language == 'python'
needs: detect
runs-on: ubuntu-latest
strategy:
matrix:
# All integrations require Python >=3.11.
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Check package exists
run: |
DIR="integrations/${{ needs.detect.outputs.framework }}/python"
if [ ! -d "$DIR" ]; then
echo "Package directory $DIR does not exist"
exit 1
fi
- name: Test Python integration
uses: ./.github/actions/test-python
with:
package: ${{ needs.detect.outputs.framework }}
python-version: ${{ matrix.python-version }}
build-python:
if: needs.detect.outputs.language == 'python'
needs: [detect, test-python]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@caf0cab7a618c569241d31dcd442f54681755d39 # v3
with:
version: "latest"
- name: Set up Python
run: uv python install 3.11
- name: Build package
working-directory: integrations/${{ needs.detect.outputs.framework }}/python
run: uv build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ needs.detect.outputs.framework }}-python-dist
path: integrations/${{ needs.detect.outputs.framework }}/python/dist/
publish-pypi:
if: needs.detect.outputs.language == 'python'
needs: [detect, test-python, build-python]
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/zep-${{ needs.detect.outputs.framework }}
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: ${{ needs.detect.outputs.framework }}-python-dist
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
with:
packages-dir: dist/
# ------------------------------------------------------------ TypeScript → npm
publish-npm:
if: needs.detect.outputs.language == 'typescript'
needs: detect
runs-on: ubuntu-latest
environment:
name: release
url: https://www.npmjs.com/package/@getzep/zep-${{ needs.detect.outputs.framework }}
defaults:
run:
working-directory: integrations/${{ needs.detect.outputs.framework }}/typescript
steps:
- uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
- name: Install npm with OIDC support
run: npm install -g npm@latest
- name: Check package exists
run: |
if [ ! -f package.json ]; then
echo "package.json not found for ${{ needs.detect.outputs.framework }}/typescript"
exit 1
fi
- name: Install, build, test
run: |
npm ci
npm run build --if-present
npm test
- name: Publish to npm
run: npm publish --access public