Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ This document outlines the release process for the Speechmatics Python SDK packa
## Overview

The Speechmatics Python SDK repository contains two separate packages:

- `speechmatics-rt` - Real-Time API Client
- `speechmatics-batch` - Batch API Client
- `speechmatics-flow` - Flow API Client
- `speechmatics-voice` - Voice Agent API Client

Each package is released independently with its own versioning and release workflow.

Expand All @@ -16,17 +18,20 @@ Each package is released independently with its own versioning and release workf
Before creating a release, ensure the following steps are completed:

### Code Quality

- [ ] All tests pass locally (`make test-all`)
- [ ] Linting passes (`make lint-all`)
- [ ] Type checking passes (`make type-check-all`)
- [ ] Examples work correctly with the new version
- [ ] Documentation is up to date

### Version Management

- [ ] Review and update README files if needed
- [ ] Verify dependencies are correct in `pyproject.toml`

### Testing

- [ ] Test examples with fresh installations
- [ ] Verify environment variables work correctly
- [ ] Test error handling scenarios
Expand All @@ -39,13 +44,15 @@ Before creating a release, ensure the following steps are completed:
To release a new version of the RT SDK:

1. **Create a Release Tag**

```bash
git tag rt/v1.0.0
git push origin rt/v1.0.0
```

2. **Automated Workflow**
The `release-rt.yaml` workflow will automatically:

- Extract version from tag (e.g., `rt/v1.0.0` → `1.0.0`)
- Run comprehensive tests across Python versions
- Update version in `sdk/rt/speechmatics/rt/__init__.py`
Expand All @@ -63,13 +70,15 @@ To release a new version of the RT SDK:
To release a new version of the Batch SDK:

1. **Create a Release Tag**

```bash
git tag batch/v1.0.0
git push origin batch/v1.0.0
```

2. **Automated Workflow**
The `release-batch.yaml` workflow will automatically:

- Extract version from tag (e.g., `batch/v1.0.0` → `1.0.0`)
- Run comprehensive tests across Python versions
- Update version in `sdk/batch/speechmatics/batch/__init__.py`
Expand All @@ -87,13 +96,15 @@ To release a new version of the Batch SDK:
To release a new version of the Flow SDK:

1. **Create a Release Tag**

```bash
git tag flow/v1.0.0
git push origin flow/v1.0.0
```

2. **Automated Workflow**
The `release-flow.yaml` workflow will automatically:

- Extract version from tag (e.g., `flow/v1.0.0` → `1.0.0`)
- Run comprehensive tests across Python versions
- Update version in `sdk/flow/speechmatics/flow/__init__.py`
Expand All @@ -106,36 +117,72 @@ To release a new version of the Flow SDK:
- Update GitHub release notes
- Announce the release

### 4. Voice Agent SDK Release

To release a new version of the Voice Agent SDK:

1. **Create a Release Tag**

```bash
git tag voice/v1.0.0
git push origin voice/v1.0.0
```

2. **Automated Workflow**
The `release-voice.yaml` workflow will automatically:

- Extract version from tag (e.g., `voice/v1.0.0` → `1.0.0`)
- Run comprehensive tests across Python versions
- Update version in `sdk/voice/speechmatics/voice/__init__.py`
- Build the package
- Publish to PyPI

3. **Manual Steps After Release**
- Verify the package is available on PyPI
- Test installation: `pip install speechmatics-voice==1.0.0`
- Update GitHub release notes
- Announce the release

## Version Management

### Version Format

Both packages follow semantic versioning (SemVer):

- `MAJOR.MINOR.PATCH` (e.g., `1.2.3`)
- `MAJOR.MINOR.PATCH-beta.N` for beta releases (e.g., `1.2.3-beta.1`)

### Version Update Process

1. **Development**: Versions remain as `0.0.0` in `__init__.py` files
2. **Release**: GitHub Actions automatically updates the version during release
3. **Post-Release**: The updated version remains in the repository

### Tag Naming Convention

- RT SDK: `rt/v{version}` (e.g., `rt/v1.0.0`)
- Batch SDK: `batch/v{version}` (e.g., `batch/v1.0.0`)
- Flow SDK: `flow/v{version}` (e.g., `flow/v1.0.0`)
- Voice Agent SDK: `voice/v{version}` (e.g., `voice/v1.0.0`)

## Environment Setup

### PyPI Configuration

Both packages are published to PyPI using GitHub Actions with OpenID Connect (OIDC):

- RT SDK: Uses `pypi-rt` environment
- Batch SDK: Uses `pypi-batch` environment
- Flow SDK: Uses `pypi-flow` environment
- Voice Agent SDK: Uses `pypi-voice` environment

### Required Secrets

No manual secrets are required as the workflows use OIDC for PyPI authentication.

## Testing Matrix

Both packages are tested against:

- Python versions: 3.9, 3.10, 3.11, 3.12, 3.13
- Operating system: Ubuntu (latest)
90 changes: 90 additions & 0 deletions .github/workflows/release-voice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Release Voice Agent SDK

on:
push:
tags:
- "voice/v*"

permissions:
contents: read
id-token: write

jobs:
extract-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.extract.outputs.version }}
steps:
- name: Extract version from tag
id: extract
run: |
# Extract version from tag (voice/v1.0.0 -> 1.0.0)
VERSION=${GITHUB_REF#refs/tags/voice/v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Extracted version: $VERSION"

test-voice:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Test Voice Agent SDK
run: |
make install-dev
make lint-voice
make test-voice

release-build:
runs-on: ubuntu-latest
needs: [extract-version, test-voice]
outputs:
version: ${{ needs.extract-version.outputs.version }}
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Update package version in sdk/voice/speechmatics/voice/__init__.py
run: |
VERSION="${{ needs.extract-version.outputs.version }}"
sed -i "s/0\.0\.0/$VERSION/g" ./sdk/voice/speechmatics/voice/__init__.py
echo "Updated version to: $VERSION"
cat ./sdk/voice/speechmatics/voice/__init__.py | grep __version__

- name: Build Voice Agent SDK
run: |
make install-dev
make build-voice

- name: Upload dist
uses: actions/upload-artifact@v4
with:
name: voice-release-dist
path: sdk/voice/dist/

pypi-publish:
runs-on: ubuntu-latest
needs: [release-build]
environment:
name: pypi-voice
url: https://pypi.org/project/speechmatics-voice/${{ needs.release-build.outputs.version }}

steps:
- name: Retrieve release dist
uses: actions/download-artifact@v4
with:
name: voice-release-dist
path: dist/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
password: ${{ secrets.PYPI_ORG_TOKEN }}
20 changes: 20 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,23 @@ jobs:
run: make test-flow
- name: Build Flow SDK
run: make build-flow

test-voice:
name: Test Voice Agent SDK
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: make install-dev
- name: Lint Voice Agent SDK
run: make lint-voice
- name: Test Voice Agent SDK
run: make test-voice
- name: Build Voice Agent SDK
run: make build-voice
Loading