Updated Voice SDK CLI example for using presets (#58) #37
Workflow file for this run
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: 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.13" | |
| - 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 }} |