name: Upload Python Package on: release: types: [published] workflow_dispatch: inputs: tag: description: 'Tag to build and publish (e.g. v5.1.0)' required: true type: string permissions: contents: read jobs: test: runs-on: ubuntu-latest timeout-minutes: 10 strategy: matrix: python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v7 with: ref: ${{ inputs.tag || github.ref }} - name: Set up uv and Python ${{ matrix.python-version }} uses: astral-sh/setup-uv@v9.0.0 with: enable-cache: true python-version: ${{ matrix.python-version }} - name: Install dependencies run: uv sync - name: Test the package run: ./test.sh deploy: runs-on: ubuntu-latest needs: [test] environment: release permissions: id-token: write steps: - uses: actions/checkout@v7 with: ref: ${{ inputs.tag || github.ref }} - name: Set up uv uses: astral-sh/setup-uv@v9.0.0 with: enable-cache: true - name: Build run: uv build - name: Publish uses: pypa/gh-action-pypi-publish@release/v1