Update release-sdk.yaml #7
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 SDK Meta-Package | |
| on: | |
| push: | |
| tags: | |
| - "sdk/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 (sdk/v1.0.0 -> 1.0.0) | |
| VERSION=${GITHUB_REF#refs/tags/sdk/v} | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Extracted version: $VERSION" | |
| release-build: | |
| runs-on: ubuntu-latest | |
| needs: [extract-version] | |
| 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/sdk/speechmatics/sdk/__init__.py | |
| run: | | |
| VERSION="${{ needs.extract-version.outputs.version }}" | |
| sed -i "s/0\.0\.0/$VERSION/g" ./sdk/sdk/speechmatics/sdk/__init__.py | |
| echo "Updated version to: $VERSION" | |
| cat ./sdk/sdk/speechmatics/sdk/__init__.py | grep __version__ | |
| - name: Build SDK meta-package | |
| run: | | |
| make install-dev | |
| make build-sdk | |
| - name: Upload dist | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sdk-release-dist | |
| path: sdk/sdk/dist/ | |
| pypi-publish: | |
| runs-on: ubuntu-latest | |
| needs: [release-build] | |
| environment: | |
| name: pypi-sdk | |
| url: https://pypi.org/project/speechmatics-sdk/${{ needs.release-build.outputs.version }} | |
| steps: | |
| - name: Retrieve release dist | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: sdk-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 }} |