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: Publish Python SDK to PyPI | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| temp_version: | |
| description: 'Optional version override (ex: 0.1.0-test)' | |
| required: false | |
| default: '' | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write # Required for trusted publishing to PyPI | |
| env: | |
| TEMP_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.temp_version || '' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| version: "latest" | |
| - name: Setup Python | |
| run: uv python install 3.12 | |
| - name: Install dependencies | |
| run: uv sync --all-extras | |
| - name: Override Python package version for testing | |
| if: env.TEMP_VERSION != '' | |
| run: | | |
| sed -i.bak "s/^version = \".*\"/version = \"$TEMP_VERSION\"/" pyproject.toml | |
| - name: Build Python package | |
| run: uv build | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |